Methods
(static) isArray(target) → {boolean}
assert is array
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is an array
- Type
- boolean
Example
isArray([]) // => true
isArray([1, 2, 3]) // => true
isArray(0) // => false
(static) isEmpty(target) → {boolean}
assert is an empty string, empty array or empty object
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is an strict object
- Type
- boolean
Example
isEmpty([]) // => true
isEmpty({}) // => true
isEmpty('') // => true
(static) isEmptyArray(target) → {boolean}
assert is an empty array
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is an empty array
- Type
- boolean
Example
isEmptyArray([]) // => true
isEmptyArray([1, 2, 3]) // => false
isEmptyArray(0) // => false
(static) isEmptyObj(target) → {boolean}
assert is an empty object
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is an empty object
- Type
- boolean
Example
isEmptyArray({}}) // => true
isEmptyArray({a: 1}) // => false
isEmptyArray(0) // => false
(static) isEmptyString(target) → {boolean}
assert is an empty string
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is an empty string
- Type
- boolean
Example
isEmptyString('') // => true
isEmptyString('123') // => false
isEmptyString(0) // => false
(static) isFalse(target) → {boolean}
assert false
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is false
- Type
- boolean
Example
isFalse(false) // => true
isFalse(0) // => false
(static) isFalsy(target) → {boolean}
assert is falsy
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)
- Type
- boolean
Example
isEmpty([]) // => true
isEmpty({}) // => true
isEmpty('') // => true
(static) isFn(target) → {boolean}
assert function type
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `typeof(target) === 'function'`
- Type
- boolean
Example
isFn(function(){}) // => true
isFn([]) // => false
(static) isInstanceOf(target, Class) → {boolean}
assert is an instance of Class
Parameters:
Name | Type | Description |
---|---|---|
target |
* | |
Class |
* | a class |
- Source:
Returns:
return `target instanceof Class`
- Type
- boolean
(static) isNull(target) → {boolean}
assert null
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is null
- Type
- boolean
Example
isNull(null) // => true
(static) isNumber(target) → {boolean}
assert number type
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `typeof(target) === 'number'`
- Type
- boolean
Example
isNumber(1) // => true
(static) isObj(target) → {boolean}
assert object type
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `typeof(target) === 'object'`
- Type
- boolean
Example
isObj([]) // => true
isObj(null) // => true
isObj('') // => false
(static) isStrictObj(target) → {boolean}
assert is an strict object (json-like)
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is an strict object
- Type
- boolean
Example
isStrictObj([]) // => false
isStrictObj({}) // => true
(static) isString(target) → {boolean}
assert string type
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `typeof(target) === 'string'`
- Type
- boolean
Example
isString('') // => true
(static) isTrue(target) → {boolean}
assert true
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is true
- Type
- boolean
Example
isFalse(false) // => false
isFalse(true) // => true
(static) isUnDef(target) → {boolean}
assert undefined type
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `typeof(target) === 'undefined'`
- Type
- boolean
Example
var a = '1', b
isUndef(a) // => false
isUndef(b) // => true
(static) isZero(target) → {boolean}
assert number zero
Parameters:
Name | Type | Description |
---|---|---|
target |
* |
- Source:
Returns:
return `true` if the target is zero
- Type
- boolean
Example
isZero(0) // => true