Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
yubaoquan committed May 2, 2024
1 parent 7ea19c1 commit 8d7f5fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ export const pickBy = <T extends object, TKeys extends keyof T>(
predicate: (value: T[TKeys]) => boolean = () => true
): Pick<T, TKeys> => {
if (!obj) return {} as Pick<T, TKeys>
return pick(obj, (Object.keys(obj) as TKeys[]).filter(key => predicate(obj[key])))
return pick(
obj,
(Object.keys(obj) as TKeys[]).filter(key => predicate(obj[key]))
)
}

/**
Expand Down Expand Up @@ -232,7 +235,10 @@ export const omitBy = <T, TKeys extends keyof T>(
predicate: (value: T[TKeys]) => boolean = () => true
): Omit<T, TKeys> => {
if (!obj) return {} as Omit<T, TKeys>
return omit(obj, (Object.keys(obj) as TKeys[]).filter(key => predicate(obj[key])))
return omit(
obj,
(Object.keys(obj) as TKeys[]).filter(key => predicate(obj[key]))
)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/tests/async.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { AggregateError } from '../async'

// fix error of calling useFakeTimers https://stackoverflow.com/a/77694958/5131623
Object.defineProperty(global, 'performance', {
writable: true,
});
writable: true
})

describe('async module', () => {
beforeEach(() => jest.useFakeTimers({ advanceTimers: true }))
Expand Down

0 comments on commit 8d7f5fe

Please sign in to comment.