Skip to content

Commit

Permalink
compareDeep was good as ===, but now it has tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sadasant committed Feb 21, 2017
1 parent 348ebd7 commit 1817f96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ export const matchesSignature = _.curry((signature, value) =>
)

// Checks if a property deep in a given item equals to a given value
export const compareDeep = _.curry((path, item, value) => _.get(path, item) == value) // eslint-disable-line eqeqeq
export const compareDeep = _.curry((path, item, value) => _.get(path, item) === value)
4 changes: 2 additions & 2 deletions test/objects.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Object Functions', function () {
const o = { a: { b: { c: 1 } } }
expect(f.compareDeep('a.b.c', o, 1)).to.deep.equal(true)
expect(f.compareDeep('a.b.c', o, 2)).to.deep.equal(false)
expect(f.compareDeep('a.b.c')(o, '1')).to.deep.equal(true)
expect(f.compareDeep('a.b.c')(o)('1')).to.deep.equal(true)
expect(f.compareDeep('a.b.c')(o, '1')).to.deep.equal(false)
expect(f.compareDeep('a.b.c')(o)('1')).to.deep.equal(false)
})
})

0 comments on commit 1817f96

Please sign in to comment.