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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    83
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    83
  • 1.0.0
    0

Package Sidebar

Install

npm i isobjectmatchingmodel

Weekly Downloads

83

Version

1.0.1

License

ISC

Unpacked Size

2.5 kB

Total Files

4

Last publish

Collaborators

  • adelerevert