Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixes equality checking for Map objects. #52
// keys are not checked const equal = require('./index.js') const a = new Map([['a', 1]]) const b = new Map([['b', 1]]) equal(a, b) // true // recursive checking for values doesn't work, either const x = new Map([['a', [1, 2]]]) const y = new Map([['a', [2, 1]]]) equal(x, y) // true // empty maps equal those with data b/c the key set is empty and the check falls all the way though the ifs const z = new Map() equal(a, z) // true
The implementation is a near duplication of the
I also made a few small changes to make the style more consistent, and added a .gitignore, but tried to not overreach or get too out of scope. I can revert these changes upon request.