You can see below the API reference of this module.
Gets the type of the input value or compares it with a provided type.
Usage:
Typpy({}) // => "object"
Typpy(42, Number); // => true
Typpy.get([], "array"); => true
- Anything
input
: The input value. - Constructor|String
target
: The target type. It could be a string (e.g."array"
) or a constructor (e.g.Array
).
- String|Boolean It returns
true
if the input has the provided typetarget
(if was provided),false
if the input type does not have the provided typetarget
or the stringified type of the input (always lowercase).
Checks if the input value has a specified type.
- Anything
input
: The input value. - Constructor|String
target
: The target type. It could be a string (e.g."array"
) or a constructor (e.g.Array
).
- Boolean
true
, if the input has the same type with the target orfalse
otherwise.
Gets the type of the input value. This is used internally.
- Anything
input
: The input value. - Boolean
str
: A flag to indicate if the return value should be a string or not.
- Constructor|String The input value constructor (if any) or the stringified type (always lowercase).