( value: boolean | OneOrMore<string> | ((key: any) => boolean) | undefined, key: string | undefined )
| 27 | |
| 28 | /** Try to coerce the given value into a boolean using the given key */ |
| 29 | export 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 | |
| 40 | export const resolveProp = <T>( |
| 41 | prop: T | Lookup<T> | undefined, |
no test coverage detected
searching dependent graphs…