Spaces:
Paused
Paused
Download node_modules/@huggingface/hub/src/utils/omit.ts from ken-q/opencode-home: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/ken-q/opencode-home/resolve/main/node_modules/%40huggingface/hub/src/utils/omit.ts
- Command line
-
hf download hf://spaces/ken-q/opencode-home/node_modules/@huggingface/hub/src/utils/omit.ts
-
curl -L -o omit.ts https://huggingface.co/spaces/ken-q/opencode-home/resolve/main/node_modules/%40huggingface/hub/src/utils/omit.ts
469 Bytes
| import { pick } from "./pick"; | |
| import { typedInclude } from "./typedInclude"; | |
| /** | |
| * Return copy of object, omitting blacklisted array of props | |
| */ | |
| export function omit<T extends Record<string, unknown>, K extends keyof T>( | |
| o: T, | |
| props: K[] | K, | |
| ): Pick<T, Exclude<keyof T, K>> { | |
| const propsArr = Array.isArray(props) ? props : [props]; | |
| const letsKeep = (Object.keys(o) as (keyof T)[]).filter((prop) => !typedInclude(propsArr, prop)); | |
| return pick(o, letsKeep); | |
| } | |