sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.81k stars 108 forks source link

Add object shape validators #127

Closed SamVerschueren closed 5 years ago

SamVerschueren commented 5 years ago

This PR introduces ow.object.partialShape and ow.object.exactShape 🎉. See #92 for the discussion.

Fixes #92

SamVerschueren commented 5 years ago

I can probably use a plainObject check from is instead of introducing a new dependency. Didn't think about it. Will fix this later this evening.

SamVerschueren commented 5 years ago

Changed isPlainObj to is.plainObject 👌

sindresorhus commented 5 years ago

Can you add a simple example of object.exactShape to the readme? (New codeblock in "Usage"). I think it's a good selling point.

sindresorhus commented 5 years ago

Looks good ✨