MCPcopy Create free account
hub / github.com/callstack/linaria / omit

Function omit

packages/react/src/styled.ts:44–56  ·  view source on GitHub ↗
(
  obj: T,
  keys: TKeys[]
)

Source from the content-addressed store, hash-verified

42 keys.indexOf(key as any) === -1;
43
44export const omit = <T extends Record<string, unknown>, TKeys extends keyof T>(
45 obj: T,
46 keys: TKeys[]
47): Omit<T, TKeys> => {
48 const res = {} as Omit<T, TKeys>;
49 Object.keys(obj)
50 .filter(filterKey(keys))
51 .forEach((key) => {
52 res[key] = obj[key];
53 });
54
55 return res;
56};
57
58function filterProps<T extends Record<string, unknown>, TKeys extends keyof T>(
59 asIs: boolean,

Callers 3

styled.test.tsxFile · 0.90
filterPropsFunction · 0.85
styledFunction · 0.85

Calls 1

filterKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…