Package Exports
- toxic-predicate-functions
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (toxic-predicate-functions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
toxic-predicate-functions
predicate functions collection
get started
npm install toxic-predicate-functions --saveif you are using flow, you should import our flow defination, by adding this to your .flowconfig.
[ignore]
[include]
[libs]
./node_modules/toxic-predicate-functions/lib/index.flow.js
[options]
[lints]doc
defined
to check whether the object is defined or not
Parameters
objany
Returns boolean
isVoid
is void element or not ? Means it will return true when val is undefined or null
Parameters
objany
Returns boolean
isArray
to check whether a variable is array
Parameters
arrany
Returns boolean
isFunction
is it a function or not
Parameters
objany
Returns boolean
isObject
is it an object or not
Parameters
objany
Returns boolean
isNumber
to tell you if it's a real number
Parameters
objany
Returns boolean
isNumeric
to tell you if the val can be transfer into number
Parameters
objany
Returns boolean
isInteger
is it an interget or not
Parameters
numany
Returns boolean
isEmpty
return true when the value is "", {}, [], 0, null, undefined, false.
Parameters
objany
Returns boolean
isEvent
is it an event or not
Parameters
objany
Returns boolean
isBlob
is it a blob
Parameters
objany
Returns boolean
isFile
is it a file uploaded by user through file inpue
Parameters
objany
Returns boolean
isDate
is it a date
Parameters
objany
Returns boolean
isString
is it a string
Parameters
strany
Returns boolean
isBoolean
is Boolean or not
Parameters
boolany
Returns boolean
isPromise
is a promise or not
Parameters
objany
Returns boolean
isPrimitive
is Primitive type or not, whick means it will return true when data is number/string/boolean/undefined/null
Parameters
valany
Returns boolean
isUrl
is it an url, but this test require the url to have an protocol
Parameters
strany
Returns boolean
isNode
to test if a HTML node
Parameters
objany
Returns boolean
isElement
to test if a HTML element
Parameters
objany
Returns boolean
isChildNode
check if node A is node B's parent or not
Parameters
Returns boolean
isPosterityNode
check if node B is node A's posterrity or not
Parameters
Returns boolean
isHTMLString
check if the string is an HTMLString
Parameters
strstring
Returns boolean
isError
check if is an error
Parameters
valany
Returns boolean
isRegExp
check if is an RegExp
Parameters
valany
Returns boolean