Kind: global constant
- Typis :
Object
- .get(object) ⇒
string
- .is(object, type) ⇒
boolean
- .throw(object, type, [msg]) ⇒
boolean
- .get(object) ⇒
Get object type
Kind: static method of Typis
Param | Type | Description |
---|---|---|
object | Object | object |
Example
typis.get('hello'); //=> String
Check object type
Kind: static method of Typis
Param | Type | Description |
---|---|---|
object | Object | object |
type | string | type string can be also lowercase |
Example
typis.is('hello', 'number'); //=> false
Check object type and throw an error if not satisfied
Kind: static method of Typis
Param | Type | Description |
---|---|---|
object | Object | object |
type | string | type string can be also lowercase |
[msg] | string | message error |
Example
try {
typis.throw('hello', 'number');
} catch(e) {
console.log(e);
}