tsame
Version:
the logic behind tap's t.same() and t.strictSame()
27 lines (18 loc) • 577 B
Markdown
Verify that two objects are the same, for use in
[](http://www.node-tap.org/). The less accepting cousin of
[](http://npm.im/tmatch).
This merges code originally found in
[](http://npm.im/only-shallow) and
[](http://npm.im/deeper). See license file for more details.
```javascript
const tsame = require('tsame')
const obj1 = { foo: '1' }
const obj2 = { foo: 1 }
// nonstrict by default
assert(tsame(obj1, obj2))
// strictly the same, types and all
assert(!tsame.strict(obj1, obj2))
```
Pretty much what it says on the tin.