Returns true if parameter is an array of strings
Throws an error if parameter is not an array
Returns fallback
if v
is NaN, otherwise returns v
.
Parses value
as an integer, returning it if it meets the range
criteria.
If not, defaultValue
is returned.
Checks if value
an integer and meets additional criteria.
See numberTest for guard details, or use that if integer checking is not required.
Returns true if value
is an integer in number or string form
Returns true if x
is a power of two
Compares two numbers with a given number of decimal places
Checks if t
is not a number or within specified range.
Returns [false, reason:string]
if invalid or [true]
if valid.
Returns test of value
being in the range of 0-1.
Equiv to number(value,
percentage);
Inclusive range 4-6 = 4, 5, 6 Exclusive range 4-6 = 5
Returns the error as a string.
Returns the first failed result, or undefined if there are no fails
Returns true if result
is an error
Returns true if result
is OK and has a value
Returns first failed result or final value.
If any of results
is an error, throws it, otherwise ignored.
Gets the result as an Error
Unwraps the result, returning its value if OK. If not, an exception is thrown.
If result
is an error, calls callback
, passing the error.
Otherwise does nothing
Throws an error if parameter is not an string
Tests_if value
is a plain object
Tests if value
is primitive value (bigint,number,string or boolean) or plain object
Throws an error if any result is a failure. Error message will be the combined from all errors.
Throws if
index
is an invalid array index forarray
, and ifarray
itself is not a valid array.