Add the object validation
Example usage:
const addressSchema = {
street: String,
number: Number,
postalCode: String,
city: String,
country: String,
};
const Address = Obj({ schema: addressSchema })
const myAddress = new Address({
street: 'Abc',
number: 42,
postalCode: '1234AB',
city: 'Example',
country: 'The Netherlands'
})
Example usage without a schema:
...
const ObjectWithoutSchema = Obj()
const flatter = new ObjectWithoutSchema({
a: 1,
b: 2,
c: [3, 4],
d: { e: 5, f: 6 },
g: { h: { i: 7 } }
})