( diffs: Array<Diff>, op: number, hasCommonDiff: boolean, )
| 255 | class="cm">// * include change substrings which have argument op |
| 256 | class="cm">// with inverse highlight only if there is a common substring |
| 257 | const getCommonAndChangedSubstrings = ( |
| 258 | diffs: Array<Diff>, |
| 259 | op: number, |
| 260 | hasCommonDiff: boolean, |
| 261 | ): string => |
| 262 | diffs.reduce( |
| 263 | (reduced: string, diff: Diff): string => |
| 264 | reduced + |
| 265 | (diff[0] === DIFF_EQUAL |
| 266 | ? diff[1] |
| 267 | : diff[0] === op |
| 268 | ? hasCommonDiff |
| 269 | ? INVERTED_COLOR(diff[1]) |
| 270 | : diff[1] |
| 271 | : class="st">''), |
| 272 | class="st">'', |
| 273 | ); |
| 274 | |
| 275 | const isLineDiffable = (expected: unknown, received: unknown): boolean => { |
| 276 | const expectedType = getType(expected); |
no outgoing calls
no test coverage detected