Methods
(inner) emptyArray() → {Array}
Returns an empty array
Returns:
Empty array
- Type
- Array
Example
emptyArray() //=> []
emptyArray('test') //=> []
emptyArray(true) //=> []
(inner) emptyObject() → {Object}
Returns an empty object
Returns:
Empty object
- Type
- Object
Example
emptyObject() //=> {}
emptyObject('test') //=> {}
emptyObject(true) //=> {}
(inner) emptyString() → {String}
Returns an empty string
Returns:
Empty string
- Type
- String
Example
emptyString() //=> ''
emptyString('test') //=> ''
emptyString(true) //=> ''
(inner) typeIs(typeName, testVal) → {Boolean}
Curried function that takes the string name of a data type per ramda#type, a value of any type, and returns a boolean to indicate whether or not the value is of specified type
Parameters:
Name | Type | Description |
---|---|---|
typeName |
String | name of the type to look for |
testVal |
* | any value of any type |
Returns:
Whether or not the value is of the specified type
- Type
- Boolean
Example
const isString = typeIs('String')
const isObject = typeIs('Object')
const insistentString = 'i AM a string'
const obj = { value: insistentString}
isString(insistentString) //=> true
isString(obj) //=> false
isObject(insistentString) //=> false
isObject(obj) //=> true