MCPcopy
hub / github.com/pmndrs/react-spring / matchProp

Function matchProp

packages/core/src/helpers.ts:29–38  ·  view source on GitHub ↗
(
  value: boolean | OneOrMore<string> | ((key: any) => boolean) | undefined,
  key: string | undefined
)

Source from the content-addressed store, hash-verified

27
28/** Try to coerce the given value into a boolean using the given key */
29export const matchProp = (
30 value: boolean | OneOrMore<string> | ((key: any) => boolean) | undefined,
31 key: string | undefined
32) =>
33 value === true ||
34 !!(
35 key &&
36 value &&
37 (is.fun(value) ? value(key) : toArray(value).includes(key))
38 )
39
40export const resolveProp = <T>(
41 prop: T | Lookup<T> | undefined,

Callers 2

schedulePropsFunction · 0.90
_mergeMethod · 0.90

Calls 1

toArrayFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…