Introduction
Usage
const isObject = require('101/isObject')
isObject({}) // → true
Every function is exposed as a module.
See: 101
Type checking
isObject({})
isString('str')
isRegExp(/regexp/)
isBoolean(true)
isEmpty({})
isfunction(x => x)
isInteger(10)
isNumber(10.1)
instanceOf(obj, 'string')
See: isObject
Objects
Example
Getting
Setting
put(state, 'user.profile.name', 'john')
See: put
Deleting
Keypath check
hasKeypaths(state, ['user'])
hasKeypaths(state, {
'user.profile.name': 'john'
})
See: hasKeypaths
Get values
values(state)
See: values
Functions
Simple functions
Composition
And/or
Converge
converge(and, [pluck('a'), pluck('b')])(x)
Result
// → and(pluck(x, 'a'), pluck(x, 'b'))
See: converge
0 Comments for this cheatsheet. Write yours!