isobjectmatchingmodel

1.0.1 • Public • Published

What is it?

Function to compare a model and an object. If object has all nested properties of model, it returns true.

Get started

npm i isobjectmatchingmodel -S

How to use it?

isObjectMatchingModel({prop1:11}, {prop1:22}); 
// output true

isObjectMatchingModel({prop1:11, prop2: {prop21: 'sugar glider'}}, {prop1:11, prop2: {prop21: 'unicorn'}}); 
// output true

isObjectMatchingModel({prop0:11, prop2: {prop21: 'sugar glider'}}, {prop1:11, prop2: {prop21: 'unicorn'}}); 
// output false

Readme

Keywords

none

Package Sidebar

Install

npm i isobjectmatchingmodel

Weekly Downloads

96

Version

1.0.1

License

ISC

Unpacked Size

2.5 kB

Total Files

4

Last publish

Collaborators

  • adelerevert