(value)
| 12 | } |
| 13 | |
| 14 | function normalizeForCompare(value) { |
| 15 | if (Array.isArray(value)) return value.map(normalizeForCompare); |
| 16 | if (!isPlainObject(value)) return value; |
| 17 | |
| 18 | return Object.keys(value).sort().reduce((result, key) => { |
| 19 | result[key] = normalizeForCompare(value[key]); |
| 20 | return result; |
| 21 | }, {}); |
| 22 | } |
| 23 | |
| 24 | function valuesAreEqual(left, right) { |
| 25 | return JSON.stringify(normalizeForCompare(left)) === JSON.stringify(normalizeForCompare(right)); |
no test coverage detected
searching dependent graphs…