mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-05 09:46:45 +00:00
16 lines
419 B
TypeScript
16 lines
419 B
TypeScript
// NOTE: This should not be exported at the top level
|
|
|
|
export function omitBy(
|
|
obj: Record<string, unknown>,
|
|
fn: (unknown, string) => unknown,
|
|
): Record<string, unknown> {
|
|
return (
|
|
Object.keys(obj)
|
|
.filter((key) => !fn(obj[key], key))
|
|
// eslint-disable-next-line no-return-assign -- it's fine
|
|
.reduce((acc, key) => ((acc[key] = obj[key]), acc), {})
|
|
)
|
|
}
|
|
|
|
export function groupBy(): void {}
|