source: node_modules/ramda/src/internal/_objectIs.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 415 bytes
RevLine 
[d24f17c]1// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2function _objectIs(a, b) {
3 // SameValue algorithm
4 if (a === b) {
5 // Steps 1-5, 7-10
6 // Steps 6.b-6.e: +0 != -0
7 return a !== 0 || 1 / a === 1 / b;
8 } else {
9 // Step 6.a: NaN == NaN
10 return a !== a && b !== b;
11 }
12}
13
14module.exports = typeof Object.is === 'function' ? Object.is : _objectIs;
Note: See TracBrowser for help on using the repository browser.