wpredicate
v1.1.0
Published
some common predicate in javascript
Downloads
5
Maintainers
Readme
wPredicate library!
There is a simple library providing some common predicate
Get started
use "npm install --save wPredicate" to grasp the library
First use
import the function you need.
e.g import { isNull } from 'predicate';
below an exhaustive list of predicate provided.
Functions
Test on immutable types
isList
isMap
isRecord
Test on javascript types
isArray
isObject
isString
isNumber
isNull
isEmpty
isUndefined
isArrayOrObject
isNullOrUndefined
isStringOrNumber
isEmptyOrString
Creator of predicate for Record type
isSpecificRecord
this function is provided to create predicate on specific record type.
e.g const Action = Record({ type: null, point: null})
const isAction = isSpecificRecord(Action);
isSpecificRecord is curried so isAction is currently a function waiting for a parameter. the parameter is the value which needs to be tested.