blob: a5913550703f5b74e28feb955f79b63936644e98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
'use strict'
const argumentsObject = require('./complexValues/arguments').tag
const constants = require('./constants')
const AMBIGUOUS = constants.AMBIGUOUS
const SHALLOW_EQUAL = constants.SHALLOW_EQUAL
function shouldCompareDeep (result, lhs, rhs) {
if (result === SHALLOW_EQUAL) return true
if (result !== AMBIGUOUS) return false
// Properties are only ambiguous if they have symbol keys. These properties
// must be compared in an order-insensitive manner.
return lhs.tag === argumentsObject || lhs.isProperty === true
}
module.exports = shouldCompareDeep
|