Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 12x 13x 9x 23x 4x 4x 5x 2x 1x 1x 13x |
export const isDefined = value => value !== undefined
export const isString = v => typeof v === 'string'
export const isRegex = v => v instanceof RegExp
export const isFn = v => typeof v === 'function'
export const checkString = str => type => str === type
export const checkRegex = re => type => re.test(type)
export const checkFn = fn => function () {
return fn(...arguments)
}
export const checkTrue = () => true
export const check = predicate => {
return (isString(predicate) && checkString(predicate)) ||
(isRegex(predicate) && checkRegex(predicate)) ||
(isFn(predicate) && checkFn(predicate)) ||
checkTrue
}
|