Trying to define a custom, plain object model constructor. But get an error:
import _ from 'lodash';
import {ObjectModel} from 'objectmodel';
const PlainObjectModel = model => ObjectModel(model).assert(_.isPlainObject);
PlainObjectModel({foo: Number})({foo: 123});
// -> TypeError: assertion "isPlainObject" returned false for value {foo: 123}
Upd: Just found out, that I can do it like this:
const PlainObjectModel = model => BasicModel(model).assert(_.isPlainObject);
Trying to define a custom, plain object model constructor. But get an error:
Upd: Just found out, that I can do it like this: