Hi !
Let's say I have objects representing a DB record and I wrote this to validate them
const myRecordType = ow.object.exactShape({
id: ow.string,
axis: ow.string.oneOf(['X', 'Y', 'Z']),
value: number,
name: ow.optional.string,
});
How can I use this to generate new empty records?
The idea would be to create a function that returns a correctly initialized object
const newRec = generateNewRecord(myRecordType);
console.dir(newRec);
/*
{
id: '',
axis: 'X',
value: 0,
name: '',
}
*/
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too