Methods
(static) isArray(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is Array
Example
RA.isArray([]); //=> true
RA.isArray(null); //=> false
RA.isArray({}); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isAsyncFunction(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is Async Function
Example
RA.isAsyncFunction(async function test() { }); //=> true
RA.isAsyncFunction(null); //=> false
RA.isAsyncFunction(function test() { }); //=> false
RA.isAsyncFunction(() => {}); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isBoolean(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is Boolean
Example
RA.isBoolean(false); //=> true
RA.isBoolean(true); //=> true
RA.isBoolean(null); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isFunction(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is Function
Example
RA.isFunction(function test() { }); //=> true
RA.isFunction(function* test() { }); //=> true
RA.isFunction(async function test() { }); //=> true
RA.isFunction(() => {}); //=> true
RA.isFunction(null); //=> false
RA.isFunction('abc'); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isGeneratorFunction(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is Generator Function
Example
RA.isGeneratorFunction(function* test() { }); //=> true
RA.isGeneratorFunction(null); //=> false
RA.isGeneratorFunction(function test() { }); //=> false
RA.isGeneratorFunction(() => {}); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNilOrEmpty(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Returns true
if the given value is its type's empty value, null
or undefined
Example
RA.isNilOrEmpty([1, 2, 3]); //=> false
RA.isNilOrEmpty([]); //=> true
RA.isNilOrEmpty(''); //=> true
RA.isNilOrEmpty(null); //=> true
RA.isNilOrEmpty(undefined): //=> true
RA.isNilOrEmpty({}); //=> true
RA.isNilOrEmpty({length: 0}); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotArray(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of Array
Example
RA.isNotArray([]); //=> false
RA.isNotArray(null); //=> true
RA.isNotArray({}); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotArrayLike(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Tests whether or not an object is similar to an array.
Example
RA.isNotArrayLike([]); //=> false
RA.isNotArrayLike(true); //=> true
RA.isNotArrayLike({}); //=> true
RA.isNotArrayLike({length: 10}); //=> true
RA.isNotArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotAsyncFunction(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of Async Function
Example
RA.isNotAsyncFunction(async function test() { }); //=> false
RA.isNotAsyncFunction(null); //=> true
RA.isNotAsyncFunction(function test() { }); //=> true
RA.isNotAsyncFunction(() => {}); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotBoolean(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of Boolean
Example
RA.isNotBoolean(false); //=> false
RA.isNotBoolean(true); //=> false
RA.isNotBoolean(null); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotEmpty(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Returns true if the given value is not its type's empty value; false
otherwise.
Example
RA.isNotEmpty([1, 2, 3]); //=> true
RA.isNotEmpty([]); //=> false
RA.isNotEmpty(''); //=> false
RA.isNotEmpty(null); //=> true
RA.isNotEmpty(undefined): //=> true
RA.isNotEmpty({}); //=> false
RA.isNotEmpty({length: 0}); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotFunction(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of Function
Example
RA.isNotFunction(function test() { }); //=> false
RA.isNotFunction(function* test() { }); //=> false
RA.isNotFunction(async function test() { }); //=> false
RA.isNotFunction(() => {}); //=> false
RA.isNotFunction(null); //=> true
RA.isNotFunction('abc'); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotGeneratorFunction(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of Generator Function
Example
RA.isNotGeneratorFunction(function* test() { }); //=> false
RA.isNotGeneratorFunction(null); //=> true
RA.isNotGeneratorFunction(function test() { }); //=> true
RA.isNotGeneratorFunction(() => {}); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotNil(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of null
or undefined
Example
RA.isNotNil(null); //=> false
RA.isNotNil(undefined); //=> false
RA.isNotNil(0); //=> true
RA.isNotNil([]); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotNull(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of null
Example
RA.isNotNull(1); //=> true
RA.isNotNull(undefined); //=> true
RA.isNotNull(null); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotObject(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of language type of Object
Example
RA.isNotObject({}); //=> false
RA.isNotObject([]); //=> false
RA.isNotObject(() => {}); //=> false
RA.isNotObject(null); //=> true
RA.isNotObject(undefined); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotObjectLike(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if value is not object-like. A value is object-like if it's not null and has a typeof result of "object".
Example
RA.isNotObjectLike({}); //=> false
RA.isNotObjectLike([]); //=> false
RA.isNotObjectLike(() => {}); //=> true
RA.isNotObjectLike(null); //=> true
RA.isNotObjectLike(undefined); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotPlainObject(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Check to see if an object is a not plain object (created using {}
, new Object()
or Object.create(null)
)
Example
class Bar {
constructor() {
this.prop = 'value';
}
}
RA.isNotPlainObject(new Bar()); //=> true
RA.isNotPlainObject({ prop: 'value' }); //=> false
RA.isNotPlainObject(['a', 'b', 'c']); //=> true
RA.isNotPlainObject(Object.create(null); //=> false
RA.isNotPlainObject(new Object()); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotString(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement of String
Example
RA.isNotString('abc'); //=> false
RA.isNotString(1); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNotUndefined(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is complement undefined
Example
RA.isNotUndefined(1); //=> true
RA.isNotUndefined(undefined); //=> false
RA.isNotUndefined(null); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isNull(val) → {Boolean}
Checks if input value is null
Example
RA.isNull(1); //=> false
RA.isNull(undefined); //=> false
RA.isNull(null); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isObject(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is language type of Object
Example
RA.isObject({}); //=> true
RA.isObject([]); //=> true
RA.isObject(() => {}); //=> true
RA.isObject(null); //=> false
RA.isObject(undefined); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isObjectLike(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if value is object-like. A value is object-like if it's not null and has a typeof result of "object".
Example
RA.isObjectLike({}); //=> true
RA.isObjectLike([]); //=> true
RA.isObjectLike(() => {}); //=> false
RA.isObjectLike(null); //=> false
RA.isObjectLike(undefined); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isPlainObject(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Check to see if an object is a plain object (created using {}
, new Object()
or Object.create(null)
)
Example
class Bar {
constructor() {
this.prop = 'value';
}
}
RA.isPlainObject(new Bar()); //=> false
RA.isPlainObject({ prop: 'value' }); //=> true
RA.isPlainObject(['a', 'b', 'c']); //=> false
RA.isPlainObject(Object.create(null); //=> true
RA.isPlainObject(new Object()); //=> true
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isString(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is String
Example
RA.isString('abc'); //=> true
RA.isString(1); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean
(static) isUndefined(val) → {Boolean}
- Source:
- Since:
- Signature:
-
* -> Boolean
- Category:
-
- Type
- See also:
Checks if input value is undefined
Example
RA.isUndefined(1); //=> false
RA.isUndefined(undefined); //=> true
RA.isUndefined(null); //=> false
Parameters:
Name | Type | Description |
---|---|---|
val |
* | The value to test |
Returns:
- Type
- Boolean