Arrays asserts.
- Source:
Methods
(inner) arrayOfBooleans(value) → {*|boolean}
Check if is an array of booleans
Interfaces: all
, any
, not
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
array
|
array |
Returns:
- Type:
-
*
|boolean
Example
be.arrayOfBooleans([true, false]) // true
be.all.arrayOfBooleans([
true,
false,
[1, 2, 3]
]) // false
(inner) arrayOfObjects(value) → {*|boolean}
Check if is an array of objects
Interfaces: all
, any
, not
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
array
|
array |
Returns:
- Type:
-
*
|boolean
Example
be.arrayOfObjects([{a:1},{b:2}]) // true
be.all.arrayOfObjects([
{a: 1},
{b: 2},
[1, 2, 3]
]) // false
(inner) arrayOfStrings(value) → {*|boolean}
Check if is an array of strings
Interfaces: all
, any
, not
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
array
|
array |
Returns:
- Type:
-
*
|boolean
Example
be.arrayOfStrings(['hello', 'world']) // true
be.all.arrayOfStrings([
['hello', 'world'],
['ciao', 'mondo']
]) // true
(inner) inArray(value, array) → {boolean}
Check if an element is in the array
Interface: not
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
Mixed
|
element to search |
array |
array
|
array where search |
Returns:
- Type:
-
boolean
Example
be.inArray('hello', ['hello', 'world']) //true
be.inArray('ciao', ['hello', 'world']) //false
be.inArray(1, true) //false
be.not.inArray(1, true) //true
be.Arrays.inArray(1, [1, 2, 3]) //true