* inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
(x, y)
| 554 | * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is |
| 555 | */ |
| 556 | function is(x, y) { |
| 557 | // SameValue algorithm |
| 558 | if (x === y) { |
| 559 | // Steps 1-5, 7-10 |
| 560 | // Steps 6.b-6.e: +0 != -0 |
| 561 | // Added the nonzero y check to make Flow happy, but it is redundant |
| 562 | return x !== 0 || y !== 0 || 1 / x === 1 / y; |
| 563 | } else { |
| 564 | // Step 6.a: NaN == NaN |
| 565 | return x !== x && y !== y; |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Performs equality by iterating through keys on an object and returning false |