(value)
| 26 | } |
| 27 | |
| 28 | function dedupeExactArrayValues(value) { |
| 29 | if (Array.isArray(value)) { |
| 30 | const seen = new Set(); |
| 31 | const result = []; |
| 32 | |
| 33 | value.forEach((entry) => { |
| 34 | const normalizedEntry = JSON.stringify(normalizeForCompare(entry)); |
| 35 | if (seen.has(normalizedEntry)) return; |
| 36 | |
| 37 | seen.add(normalizedEntry); |
| 38 | result.push(dedupeExactArrayValues(entry)); |
| 39 | }); |
| 40 | |
| 41 | return result; |
| 42 | } |
| 43 | |
| 44 | if (isPlainObject(value)) { |
| 45 | return Object.keys(value).reduce((result, key) => { |
| 46 | result[key] = dedupeExactArrayValues(value[key]); |
| 47 | return result; |
| 48 | }, {}); |
| 49 | } |
| 50 | |
| 51 | return value; |
| 52 | } |
| 53 | |
| 54 | function formatPath(path) { |
| 55 | return path.length ? path.join('.') : '<root>'; |
no test coverage detected
searching dependent graphs…