vanilla-object-parser
v1.0.3
Published
Simple vanilla object parser
Downloads
130
Readme
vanilla-object-parser
Simple vanilla object parser
Sample schema
const userSchema = {
user: {
type: 'object',
properties: {
name: { type: 'string' },
lastName: { type: 'string' },
},
},
};
Sample input
const obj = {
user: {
name: 'Jhon',
lastName: 'Wick',
password: '123456',
},
};
Sample usage
const { getObjectBySchema } = require('vanilla-object-parser');
const output = getObjectBySchema(obj, userSchema);
console.log(output);