We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Due to the way Arrays are identified, it is possible to construct an object which "looks like" an array, but only when passed as the second argument:
const v1 = ['a', 'b']; const v2 = { 0: 'a', 1: 'b', 2: 'c', length: 2, constructor: Array }; equal(v1, v2); // = true equal(v2, v1); // = false
It doesn't seem particularly problematic or risky either way, but the asymmetry of the arguments is surprising.
There is also a similar (related?) issue that any extra properties on an array are not checked:
const v1 = Object.assign(['a', 'b'], { woo: 'hi' }); const v2 = ['a', 'b']; equal(v1, v2); // = true equal(v2, v1); // = true
Both of these behaviours diverge from the behaviour of util.isDeepStrictEqual
util.isDeepStrictEqual
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Due to the way Arrays are identified, it is possible to construct an object which "looks like" an array, but only when passed as the second argument:
It doesn't seem particularly problematic or risky either way, but the asymmetry of the arguments is surprising.
There is also a similar (related?) issue that any extra properties on an array are not checked:
Both of these behaviours diverge from the behaviour of
util.isDeepStrictEqual
The text was updated successfully, but these errors were encountered: