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
just.check(null, {}, "null", []); // false. Neither is `null`.
just.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