JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 110
  • Score
    100M100P100Q90502F
  • License MIT

predicate functions

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

Build Status Coverage Status npm dependency Status devDependency Status Greenkeeper badge

predicate functions collection

get started

npm install toxic-predicate-functions --save

if 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

src/index.js:5-7

to check whether the object is defined or not

Parameters

  • obj any

Returns boolean

isVoid

src/index.js:11-13

is void element or not ? Means it will return true when val is undefined or null

Parameters

  • obj any

Returns boolean

isArray

src/index.js:17-19

to check whether a variable is array

Parameters

  • arr any

Returns boolean

isFunction

src/index.js:24-26

is it a function or not

Parameters

  • obj any

Returns boolean

isObject

src/index.js:31-34

is it an object or not

Parameters

  • obj any

Returns boolean

isNumber

src/index.js:38-40

to tell you if it's a real number

Parameters

  • obj any

Returns boolean

isNumeric

src/index.js:44-46

to tell you if the val can be transfer into number

Parameters

  • obj any

Returns boolean

isInteger

src/index.js:50-52

is it an interget or not

Parameters

  • num any

Returns boolean

isEmpty

src/index.js:57-65

return true when the value is "", {}, [], 0, null, undefined, false.

Parameters

  • obj any

Returns boolean

isEvent

src/index.js:69-71

is it an event or not

Parameters

  • obj any

Returns boolean

isBlob

src/index.js:75-77

is it a blob

Parameters

  • obj any

Returns boolean

isFile

src/index.js:81-83

is it a file uploaded by user through file inpue

Parameters

  • obj any

Returns boolean

isDate

src/index.js:87-89

is it a date

Parameters

  • obj any

Returns boolean

isString

src/index.js:93-96

is it a string

Parameters

  • str any

Returns boolean

isBoolean

src/index.js:100-102

is Boolean or not

Parameters

  • bool any

Returns boolean

isPromise

src/index.js:106-108

is a promise or not

Parameters

  • obj any

Returns boolean

isPrimitive

src/index.js:112-114

is Primitive type or not, whick means it will return true when data is number/string/boolean/undefined/null

Parameters

  • val any

Returns boolean

isUrl

src/index.js:118-120

is it an url, but this test require the url to have an protocol

Parameters

  • str any

Returns boolean

isNode

src/index.js:124-131

to test if a HTML node

Parameters

  • obj any

Returns boolean

isElement

src/index.js:135-143

to test if a HTML element

Parameters

  • obj any

Returns boolean

isChildNode

src/index.js:147-152

check if node A is node B's parent or not

Parameters

Returns boolean

isPosterityNode

src/index.js:156-167

check if node B is node A's posterrity or not

Parameters

Returns boolean

isHTMLString

src/index.js:171-173

check if the string is an HTMLString

Parameters

Returns boolean

isError

src/index.js:177-179

check if is an error

Parameters

  • val any

Returns boolean

isRegExp

src/index.js:183-185

check if is an RegExp

Parameters

  • val any

Returns boolean