Methods
(static) doesObjectContainsProperty(objnullable, propNamenullable, includeInheritedopt) → {boolean}
Tell if the given object contains the given property.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
object |
<nullable> |
the object to check | |
propName |
string |
<nullable> |
the name of the property | |
includeInherited |
boolean |
<optional> |
false | specify if search in nested/inherited properties |
- Source:
Returns:
- Type
- boolean
(static) doesObjectContainsStandardProperty(objnullable, isPropStandardnullable) → {boolean}
Tell if the given object contains at least one property that has a standard (reserved) property name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object |
<nullable> |
the object to check |
isPropStandard |
function |
<nullable> |
the function that tell the given argument (property), if it's standard |
- Source:
Returns:
- Type
- boolean
(static) doesStringIsStandardProperty(strnullable, isPropStandardnullable) → {boolean}
Tell if the given string has a standard (reserved) property name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
str |
string |
<nullable> |
the string to check |
isPropStandard |
function |
<nullable> |
the function that tell the given argument (property), if it's standard |
- Source:
Returns:
- Type
- boolean
(static) ensureIsArray(argnullable, nameopt) → {TypeError}
Ensure that the given argument is an array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsBoolean(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a boolean.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsClass(argnullable, classReferencenullable, nameopt) → {TypeError}
Ensure that the given argument is an instance of the given class reference.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
classReference |
object |
<nullable> |
the class that should be implemented/extended | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsDate(argnullable, nameopt) → {Error}
Ensure that the given argument is a date.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsDateFuture(argnullable, nameopt) → {Error}
Ensure that the given argument is a date in the future or now.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsDatePast(argnullable, nameopt) → {Error}
Ensure that the given argument is a date in the past or now.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsDefinedAndNotNull(argnullable, nameopt) → {TypeError}
Ensure that the given argument is defined and not null.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsError(argnullable, nameopt) → {Error}
Ensure that the given argument is an error instance or its subclass.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsFunction(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsNull(argnullable, nameopt) → {TypeError}
Ensure that the given argument is null.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsNumber(argnullable, nameopt) → {Error}
Ensure that the given argument is a number.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsObject(argnullable, nameopt) → {TypeError}
Ensure that the given argument is an object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollection(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionNotArray(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection, not an array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionNotString(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection, not a string.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionOrArray(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection or an array.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionOrArrayNotValue(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection or an array, not a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionOrArrayOrValue(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection or an array, or a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionOrString(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection, or a string.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectOrCollectionOrValue(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object or a collection, or a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsObjectPlain(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a plain object and not: undefined, null, Array, Date, Number, String, Symbol, Map/WeakMap, Set/WeakSet, etc.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsString(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a string.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsStringNotEmpty(argnullable, nameopt) → {Error}
Ensure that the given argument is a not empty string.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsUndefined(argnullable, nameopt) → {TypeError}
Ensure that the given argument is undefined.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsUndefinedOrNull(argnullable, nameopt) → {TypeError}
Ensure that the given argument is undefined or null.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsURI(argnullable, basenullable, nameopt) → {Error}
Ensure that the given argument is an URI/URL.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
base |
string |
<nullable> |
the (optional) base to build the full URL | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureIsValue(argnullable, nameopt) → {TypeError}
Ensure that the given argument is a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- TypeError
(static) ensureIsVersion(argnullable, nameopt) → {Error}
Ensure that the given argument is a string version.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Returns:
- Type
- Error
(static) ensureObjectContainsProperty(objnullable, propNamenullable, includeInheritedopt, nameopt) → {boolean}
Ensure that the given object contains the given property.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
object |
<nullable> |
the object to check | |
propName |
string |
<nullable> |
the name of the property | |
includeInherited |
boolean |
<optional> |
false | specify if search in nested/inherited properties |
name |
string |
<optional> |
'arg' | the name to use in generated error (for the first argument) |
- Source:
Returns:
- Type
- boolean
(static) ensureObjectDoesNotContainsStandardProperty(argnullable, isPropStandardnullable, nameopt) → {Error}
Ensure that the given object does not contain any property that has a standard (reserved) property name.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
isPropStandard |
function |
<nullable> |
the function that tell the given argument (property), if it's standard | |
name |
string |
<optional> |
'arg' | the name to use in generated error (for the first argument) |
- Source:
Returns:
- Type
- Error
(static) getArgumentName(argnullable) → {string}
Return the name of the variable given as argument.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the argument |
- Source:
Returns:
- Type
- string
(static) getArgumentValue(argnullable) → {string}
Return the value of the variable given as argument.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the argument |
- Source:
Returns:
- Type
- string
(static) getObjectFilteredProperties(objnullable, propFilternullable) → {object}
Return a copy of the given ibject, with all properties filtered by the given function (predicate).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object |
<nullable> |
the base object |
propFilter |
function |
<nullable> |
the function (predicate) for filtering properties |
- Source:
Throws:
-
if obj is not a plain object, or propFilter is not a function
- Type
- TypeError
Returns:
- Type
- object
(static) getOrElse(argnullable, defnullable) → {object}
Return the argument if it's defined and not null, otherwise the given default value is returned.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the argument to return |
def |
object |
<nullable> |
the default value to return |
- Source:
Returns:
- Type
- object
(static) getSize(argnullable) → {number}
Tell the size of the given object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Throws:
-
if it's not an array nor a collection nor object nor a string
- Type
- TypeError
Returns:
- Type
- number
(static) getSizeInBytes(strnullable) → {number}
Tell the size in bytes of the given string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
str |
string |
<nullable> |
the string to check |
- Source:
Throws:
-
if it's not a string
- Type
- TypeError
Returns:
- Type
- number
(static) isArray(argnullable) → {boolean}
Tell if the given argument is an array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isBoolean(argnullable) → {boolean}
Tell if the given argument is a boolean.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isClass(argnullable, classReferencenullable) → {boolean}
Tell if the given argument is an instance of the given class reference.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
classReference |
object |
<nullable> |
the class that should be implemented/extended |
- Source:
Returns:
- Type
- boolean
(static) isDate(argnullable) → {boolean}
Tell if the given argument is a date.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isDateFuture(argnullable) → {boolean}
Tell if the given argument is a valid date and in the future or now.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isDatePast(argnullable) → {boolean}
Tell if the given argument is a valid date and in the past or now.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isDateValid(argnullable) → {boolean}
Tell if the given argument is a valid date.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isDefinedAndNotNull(argnullable) → {boolean}
Tell if the given argument is defined and not null.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isError(argnullable) → {boolean}
Tell if the given argument is an error.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isFunction(argnullable) → {boolean}
Tell if the given argument is a function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isKeyedCollection(argnullable) → {boolean}
Tell if the given argument is a keyed collection.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isNull(argnullable) → {boolean}
Tell if the given argument is null.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isNumber(argnullable) → {boolean}
Tell if the given argument is a number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObject(argnullable) → {boolean}
Tell if the given argument is an object and is defined and not null.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollection(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionNotArray(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection, but not an array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionNotString(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection, but not a string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionOrArray(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection or an array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionOrArrayNotValue(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection or an array, but not a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionOrArrayOrValue(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection or an array, or a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionOrString(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection, or a string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectOrCollectionOrValue(argnullable) → {boolean}
Tell if the given argument is a plain object or a keyed collection, or a value (string or boolean or number).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isObjectPlain(argnullable) → {boolean}
Tell if the given argument is a plain object and not: undefined, null, Array, Date, Number, String, Symbol, Map/WeakMap, Set/WeakSet, etc.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isString(argnullable) → {boolean}
Tell if the given argument is a string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isStringNotEmpty(argnullable) → {boolean}
Tell if the given argument is a not empty string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isUndefined(argnullable) → {boolean}
Tell if the given argument is undefined.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isUndefinedOrNull(argnullable) → {boolean}
Tell if the given argument is undefined or null.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isURI(argnullable, basenullable) → {boolean}
Tell if the given argument is an URI or an URL.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
string |
<nullable> |
the uri/url to check |
base |
string |
<nullable> |
the (optional) base to build the full URL |
- Source:
Returns:
- Type
- boolean
(static) isValue(argnullable) → {boolean}
Tell if the given argument is a normal value (string or boolean or number).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Returns:
- Type
- boolean
(static) isVersion(argnullable) → {boolean}
Tell if the given argument is a string representation of a version number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
string |
<nullable> |
the version string to check |
- Source:
Returns:
- Type
- boolean
(static) throwOnError(argnullable)
Throw if the given argument is an error instance or its subclass.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<nullable> |
the object to check |
- Source:
Throws:
-
the given error
- Type
- Error
(static) throwOnFalse(argnullable, nameopt)
Throw if the given argument is false.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arg |
object |
<nullable> |
the object to check | |
name |
string |
<optional> |
'arg' | the name to use in generated error (or the value of first argument if not given) |
- Source:
Throws:
-
if the given argument is not a boolean, or if it's false
- Type
- Error