Skip to content

Commit

Permalink
fix: contributor frontend 4 (#57)
Browse files Browse the repository at this point in the history
* fix: prepare arg

* fix: don't unpack date
  • Loading branch information
SKairinos authored Sep 16, 2024
1 parent eb6ee32 commit 11fb8f8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,15 @@ export function excludeKeyPaths(
function _excludeKeyPaths(obj: object, path: string[]) {
return Object.fromEntries(
Object.entries(obj)
.map(([key, value]) => {
.map(([key, value]: [string, unknown]) => {
const _path = [...path, key]

if (typeof value === "object") value = _excludeKeyPaths(value, _path)
if (
typeof value === "object" &&
value !== null &&
!(value instanceof Date)
)
value = _excludeKeyPaths(value, _path)

return exclude.includes(_path.join(delimiter)) ? [] : [key, value]
})
Expand Down

0 comments on commit 11fb8f8

Please sign in to comment.