1.0.3 • Published 9 months ago

vanilla-object-parser v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

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);
1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago