just.check(value, ...otherValuesopt) → {boolean}
Checks if value looks like the other values.
Parameters:
Name
Type
Description
value
Any
Comparison value.
otherValues
[optional]
[repeatable]
Any
Values to check against.
Returns:
`true` if some other value looks like value.
-
Type
-
boolean
Example
Name | Type | Description |
---|---|---|
value
|
Any | Comparison value. |
otherValues
[optional] [repeatable] |
Any | Values to check against. |
check(null, {}, "null", []); // false. Neither is `null`.
check({}, [], {}); // true. {} is {}.
Methods
throwable(value, ...otherValuesopt) → {value}
A function that checks a value against others and
throws if the result is `false`.
This:
Parameters:
Name | Type | Description |
---|---|---|
value
|
Any | Comparison value. |
otherValues
[optional] [repeatable] |
Any | Values to check against. |
Throws:
If check returns `false`.
- Type
- TypeError
Returns:
value if check returns `true`.
- Type
- value