Constructor
new IsObject()
A constraint to check if a value is an object
- Since
- 1.3.0
- Copyright
- schukai GmbH
- License
- AGPLv3
Example
import {IsObject} from '@schukai/monster/source/constraints/isobject.mjs';
new IsObject()
.isValid({})
.then(() => console.log(true));
// ↦ true
new IsObject()
.isValid(99)
.catch(e => console.log(e));
// ↦ 99
Members
(static) instanceSymbol
This method is called by the
instanceof
operator.This method is called by the instanceof
operator.
- Since
- 2.1.0
Methods
isValid(value) → {Promise}
this method return a promise containing the result of the check.
this method return a promise containing the result of the check.
Parameters:
Name | Type | Description |
---|---|---|
value | * |
Returns:
- Type:
- Promise