( a: number | boolean, b: number | boolean, options?: DiffOptions, memorize: Memorize = DEFAULT_MEMORIZE, )
| 153 | } |
| 154 | |
| 155 | function comparePrimitive( |
| 156 | a: number | boolean, |
| 157 | b: number | boolean, |
| 158 | options?: DiffOptions, |
| 159 | memorize: Memorize = DEFAULT_MEMORIZE, |
| 160 | ) { |
| 161 | const aFormat = memorize('expected', prettyFormat(a, FORMAT_OPTIONS)) |
| 162 | const bFormat = memorize('actual', prettyFormat(b, FORMAT_OPTIONS)) |
| 163 | return aFormat === bFormat |
| 164 | ? '' |
| 165 | : diffLinesUnified(aFormat.split('\n'), bFormat.split('\n'), options) |
| 166 | } |
| 167 | |
| 168 | function sortMap(map: Map<unknown, unknown>) { |
| 169 | return new Map(Array.from(map.entries()).sort()) |
no test coverage detected