@xyne/xyne-cli-linux-x64 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/package.json +1 -1
  2. package/xyne-linux-x64 +0 -0
  3. package/node_modules/@opentui/core/node_modules/diff/CONTRIBUTING.md +0 -28
  4. package/node_modules/@opentui/core/node_modules/diff/LICENSE +0 -29
  5. package/node_modules/@opentui/core/node_modules/diff/README.md +0 -378
  6. package/node_modules/@opentui/core/node_modules/diff/dist/diff.js +0 -1674
  7. package/node_modules/@opentui/core/node_modules/diff/dist/diff.min.js +0 -1
  8. package/node_modules/@opentui/core/node_modules/diff/eslint.config.mjs +0 -182
  9. package/node_modules/@opentui/core/node_modules/diff/libcjs/convert/dmp.d.ts +0 -8
  10. package/node_modules/@opentui/core/node_modules/diff/libcjs/convert/dmp.d.ts.map +0 -1
  11. package/node_modules/@opentui/core/node_modules/diff/libcjs/convert/dmp.js +0 -24
  12. package/node_modules/@opentui/core/node_modules/diff/libcjs/convert/xml.d.ts +0 -6
  13. package/node_modules/@opentui/core/node_modules/diff/libcjs/convert/xml.d.ts.map +0 -1
  14. package/node_modules/@opentui/core/node_modules/diff/libcjs/convert/xml.js +0 -34
  15. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/array.d.ts +0 -19
  16. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/array.d.ts.map +0 -1
  17. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/array.js +0 -40
  18. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/base.d.ts +0 -20
  19. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/base.d.ts.map +0 -1
  20. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/base.js +0 -265
  21. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/character.d.ts +0 -19
  22. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/character.d.ts.map +0 -1
  23. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/character.js +0 -31
  24. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/css.d.ts +0 -18
  25. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/css.d.ts.map +0 -1
  26. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/css.js +0 -34
  27. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/json.d.ts +0 -24
  28. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/json.d.ts.map +0 -1
  29. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/json.js +0 -105
  30. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/line.d.ts +0 -24
  31. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/line.d.ts.map +0 -1
  32. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/line.js +0 -89
  33. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/sentence.d.ts +0 -21
  34. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/sentence.d.ts.map +0 -1
  35. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/sentence.js +0 -67
  36. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/word.d.ts +0 -35
  37. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/word.d.ts.map +0 -1
  38. package/node_modules/@opentui/core/node_modules/diff/libcjs/diff/word.js +0 -307
  39. package/node_modules/@opentui/core/node_modules/diff/libcjs/index.d.ts +0 -20
  40. package/node_modules/@opentui/core/node_modules/diff/libcjs/index.d.ts.map +0 -1
  41. package/node_modules/@opentui/core/node_modules/diff/libcjs/index.js +0 -61
  42. package/node_modules/@opentui/core/node_modules/diff/libcjs/package.json +0 -1
  43. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/apply.d.ts +0 -62
  44. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/apply.d.ts.map +0 -1
  45. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/apply.js +0 -267
  46. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/create.d.ts +0 -100
  47. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/create.d.ts.map +0 -1
  48. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/create.js +0 -223
  49. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/line-endings.d.ts +0 -17
  50. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/line-endings.d.ts.map +0 -1
  51. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/line-endings.js +0 -61
  52. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/parse.d.ts +0 -8
  53. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/parse.d.ts.map +0 -1
  54. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/parse.js +0 -133
  55. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/reverse.d.ts +0 -9
  56. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/reverse.d.ts.map +0 -1
  57. package/node_modules/@opentui/core/node_modules/diff/libcjs/patch/reverse.js +0 -37
  58. package/node_modules/@opentui/core/node_modules/diff/libcjs/types.d.ts +0 -213
  59. package/node_modules/@opentui/core/node_modules/diff/libcjs/types.d.ts.map +0 -1
  60. package/node_modules/@opentui/core/node_modules/diff/libcjs/types.js +0 -2
  61. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/array.d.ts +0 -3
  62. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/array.d.ts.map +0 -1
  63. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/array.js +0 -21
  64. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/distance-iterator.d.ts +0 -2
  65. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/distance-iterator.d.ts.map +0 -1
  66. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/distance-iterator.js +0 -40
  67. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/params.d.ts +0 -4
  68. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/params.d.ts.map +0 -1
  69. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/params.js +0 -17
  70. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/string.d.ts +0 -18
  71. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/string.d.ts.map +0 -1
  72. package/node_modules/@opentui/core/node_modules/diff/libcjs/util/string.js +0 -141
  73. package/node_modules/@opentui/core/node_modules/diff/libesm/convert/dmp.d.ts +0 -8
  74. package/node_modules/@opentui/core/node_modules/diff/libesm/convert/dmp.d.ts.map +0 -1
  75. package/node_modules/@opentui/core/node_modules/diff/libesm/convert/dmp.js +0 -21
  76. package/node_modules/@opentui/core/node_modules/diff/libesm/convert/xml.d.ts +0 -6
  77. package/node_modules/@opentui/core/node_modules/diff/libesm/convert/xml.d.ts.map +0 -1
  78. package/node_modules/@opentui/core/node_modules/diff/libesm/convert/xml.js +0 -31
  79. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/array.d.ts +0 -19
  80. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/array.d.ts.map +0 -1
  81. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/array.js +0 -16
  82. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/base.d.ts +0 -20
  83. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/base.d.ts.map +0 -1
  84. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/base.js +0 -253
  85. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/character.d.ts +0 -19
  86. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/character.d.ts.map +0 -1
  87. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/character.js +0 -7
  88. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/css.d.ts +0 -18
  89. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/css.d.ts.map +0 -1
  90. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/css.js +0 -10
  91. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/json.d.ts +0 -24
  92. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/json.d.ts.map +0 -1
  93. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/json.js +0 -78
  94. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/line.d.ts +0 -24
  95. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/line.d.ts.map +0 -1
  96. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/line.js +0 -65
  97. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/sentence.d.ts +0 -21
  98. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/sentence.d.ts.map +0 -1
  99. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/sentence.js +0 -43
  100. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/word.d.ts +0 -35
  101. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/word.d.ts.map +0 -1
  102. package/node_modules/@opentui/core/node_modules/diff/libesm/diff/word.js +0 -276
  103. package/node_modules/@opentui/core/node_modules/diff/libesm/index.d.ts +0 -20
  104. package/node_modules/@opentui/core/node_modules/diff/libesm/index.d.ts.map +0 -1
  105. package/node_modules/@opentui/core/node_modules/diff/libesm/index.js +0 -30
  106. package/node_modules/@opentui/core/node_modules/diff/libesm/package.json +0 -1
  107. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/apply.d.ts +0 -62
  108. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/apply.d.ts.map +0 -1
  109. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/apply.js +0 -257
  110. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/create.d.ts +0 -100
  111. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/create.d.ts.map +0 -1
  112. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/create.js +0 -201
  113. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/line-endings.d.ts +0 -17
  114. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/line-endings.d.ts.map +0 -1
  115. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/line-endings.js +0 -44
  116. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/parse.d.ts +0 -8
  117. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/parse.d.ts.map +0 -1
  118. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/parse.js +0 -130
  119. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/reverse.d.ts +0 -9
  120. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/reverse.d.ts.map +0 -1
  121. package/node_modules/@opentui/core/node_modules/diff/libesm/patch/reverse.js +0 -23
  122. package/node_modules/@opentui/core/node_modules/diff/libesm/types.d.ts +0 -213
  123. package/node_modules/@opentui/core/node_modules/diff/libesm/types.d.ts.map +0 -1
  124. package/node_modules/@opentui/core/node_modules/diff/libesm/types.js +0 -1
  125. package/node_modules/@opentui/core/node_modules/diff/libesm/util/array.d.ts +0 -3
  126. package/node_modules/@opentui/core/node_modules/diff/libesm/util/array.d.ts.map +0 -1
  127. package/node_modules/@opentui/core/node_modules/diff/libesm/util/array.js +0 -17
  128. package/node_modules/@opentui/core/node_modules/diff/libesm/util/distance-iterator.d.ts +0 -2
  129. package/node_modules/@opentui/core/node_modules/diff/libesm/util/distance-iterator.d.ts.map +0 -1
  130. package/node_modules/@opentui/core/node_modules/diff/libesm/util/distance-iterator.js +0 -37
  131. package/node_modules/@opentui/core/node_modules/diff/libesm/util/params.d.ts +0 -4
  132. package/node_modules/@opentui/core/node_modules/diff/libesm/util/params.d.ts.map +0 -1
  133. package/node_modules/@opentui/core/node_modules/diff/libesm/util/params.js +0 -14
  134. package/node_modules/@opentui/core/node_modules/diff/libesm/util/string.d.ts +0 -18
  135. package/node_modules/@opentui/core/node_modules/diff/libesm/util/string.d.ts.map +0 -1
  136. package/node_modules/@opentui/core/node_modules/diff/libesm/util/string.js +0 -128
  137. package/node_modules/@opentui/core/node_modules/diff/package.json +0 -131
  138. package/node_modules/@opentui/core/node_modules/diff/release-notes.md +0 -397
@@ -1,44 +0,0 @@
1
- export function unixToWin(patch) {
2
- if (Array.isArray(patch)) {
3
- // It would be cleaner if instead of the line below we could just write
4
- // return patch.map(unixToWin)
5
- // but mysteriously TypeScript (v5.7.3 at the time of writing) does not like this and it will
6
- // refuse to compile, thinking that unixToWin could then return StructuredPatch[][] and the
7
- // result would be incompatible with the overload signatures.
8
- // See bug report at https://github.com/microsoft/TypeScript/issues/61398.
9
- return patch.map(p => unixToWin(p));
10
- }
11
- return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map(hunk => (Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map((line, i) => {
12
- var _a;
13
- return (line.startsWith('\\') || line.endsWith('\r') || ((_a = hunk.lines[i + 1]) === null || _a === void 0 ? void 0 : _a.startsWith('\\')))
14
- ? line
15
- : line + '\r';
16
- }) }))) });
17
- }
18
- export function winToUnix(patch) {
19
- if (Array.isArray(patch)) {
20
- // (See comment above equivalent line in unixToWin)
21
- return patch.map(p => winToUnix(p));
22
- }
23
- return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map(hunk => (Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map(line => line.endsWith('\r') ? line.substring(0, line.length - 1) : line) }))) });
24
- }
25
- /**
26
- * Returns true if the patch consistently uses Unix line endings (or only involves one line and has
27
- * no line endings).
28
- */
29
- export function isUnix(patch) {
30
- if (!Array.isArray(patch)) {
31
- patch = [patch];
32
- }
33
- return !patch.some(index => index.hunks.some(hunk => hunk.lines.some(line => !line.startsWith('\\') && line.endsWith('\r'))));
34
- }
35
- /**
36
- * Returns true if the patch uses Windows line endings and only Windows line endings.
37
- */
38
- export function isWin(patch) {
39
- if (!Array.isArray(patch)) {
40
- patch = [patch];
41
- }
42
- return patch.some(index => index.hunks.some(hunk => hunk.lines.some(line => line.endsWith('\r'))))
43
- && patch.every(index => index.hunks.every(hunk => hunk.lines.every((line, i) => { var _a; return line.startsWith('\\') || line.endsWith('\r') || ((_a = hunk.lines[i + 1]) === null || _a === void 0 ? void 0 : _a.startsWith('\\')); })));
44
- }
@@ -1,8 +0,0 @@
1
- import type { StructuredPatch } from '../types.js';
2
- /**
3
- * Parses a patch into structured data, in the same structure returned by `structuredPatch`.
4
- *
5
- * @return a JSON object representation of the a patch, suitable for use with the `applyPatch` method.
6
- */
7
- export declare function parsePatch(uniDiff: string): StructuredPatch[];
8
- //# sourceMappingURL=parse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/patch/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CAiJ7D"}
@@ -1,130 +0,0 @@
1
- /**
2
- * Parses a patch into structured data, in the same structure returned by `structuredPatch`.
3
- *
4
- * @return a JSON object representation of the a patch, suitable for use with the `applyPatch` method.
5
- */
6
- export function parsePatch(uniDiff) {
7
- const diffstr = uniDiff.split(/\n/), list = [];
8
- let i = 0;
9
- function parseIndex() {
10
- const index = {};
11
- list.push(index);
12
- // Parse diff metadata
13
- while (i < diffstr.length) {
14
- const line = diffstr[i];
15
- // File header found, end parsing diff metadata
16
- if ((/^(---|\+\+\+|@@)\s/).test(line)) {
17
- break;
18
- }
19
- // Diff index
20
- const header = (/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/).exec(line);
21
- if (header) {
22
- index.index = header[1];
23
- }
24
- i++;
25
- }
26
- // Parse file headers if they are defined. Unified diff requires them, but
27
- // there's no technical issues to have an isolated hunk without file header
28
- parseFileHeader(index);
29
- parseFileHeader(index);
30
- // Parse hunks
31
- index.hunks = [];
32
- while (i < diffstr.length) {
33
- const line = diffstr[i];
34
- if ((/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/).test(line)) {
35
- break;
36
- }
37
- else if ((/^@@/).test(line)) {
38
- index.hunks.push(parseHunk());
39
- }
40
- else if (line) {
41
- throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(line));
42
- }
43
- else {
44
- i++;
45
- }
46
- }
47
- }
48
- // Parses the --- and +++ headers, if none are found, no lines
49
- // are consumed.
50
- function parseFileHeader(index) {
51
- const fileHeader = (/^(---|\+\+\+)\s+(.*)\r?$/).exec(diffstr[i]);
52
- if (fileHeader) {
53
- const data = fileHeader[2].split('\t', 2), header = (data[1] || '').trim();
54
- let fileName = data[0].replace(/\\\\/g, '\\');
55
- if ((/^".*"$/).test(fileName)) {
56
- fileName = fileName.substr(1, fileName.length - 2);
57
- }
58
- if (fileHeader[1] === '---') {
59
- index.oldFileName = fileName;
60
- index.oldHeader = header;
61
- }
62
- else {
63
- index.newFileName = fileName;
64
- index.newHeader = header;
65
- }
66
- i++;
67
- }
68
- }
69
- // Parses a hunk
70
- // This assumes that we are at the start of a hunk.
71
- function parseHunk() {
72
- var _a;
73
- const chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
74
- const hunk = {
75
- oldStart: +chunkHeader[1],
76
- oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
77
- newStart: +chunkHeader[3],
78
- newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
79
- lines: []
80
- };
81
- // Unified Diff Format quirk: If the chunk size is 0,
82
- // the first number is one lower than one would expect.
83
- // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
84
- if (hunk.oldLines === 0) {
85
- hunk.oldStart += 1;
86
- }
87
- if (hunk.newLines === 0) {
88
- hunk.newStart += 1;
89
- }
90
- let addCount = 0, removeCount = 0;
91
- for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a = diffstr[i]) === null || _a === void 0 ? void 0 : _a.startsWith('\\'))); i++) {
92
- const operation = (diffstr[i].length == 0 && i != (diffstr.length - 1)) ? ' ' : diffstr[i][0];
93
- if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
94
- hunk.lines.push(diffstr[i]);
95
- if (operation === '+') {
96
- addCount++;
97
- }
98
- else if (operation === '-') {
99
- removeCount++;
100
- }
101
- else if (operation === ' ') {
102
- addCount++;
103
- removeCount++;
104
- }
105
- }
106
- else {
107
- throw new Error(`Hunk at line ${chunkHeaderIndex + 1} contained invalid line ${diffstr[i]}`);
108
- }
109
- }
110
- // Handle the empty block count case
111
- if (!addCount && hunk.newLines === 1) {
112
- hunk.newLines = 0;
113
- }
114
- if (!removeCount && hunk.oldLines === 1) {
115
- hunk.oldLines = 0;
116
- }
117
- // Perform sanity checking
118
- if (addCount !== hunk.newLines) {
119
- throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
120
- }
121
- if (removeCount !== hunk.oldLines) {
122
- throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
123
- }
124
- return hunk;
125
- }
126
- while (i < diffstr.length) {
127
- parseIndex();
128
- }
129
- return list;
130
- }
@@ -1,9 +0,0 @@
1
- import type { StructuredPatch } from '../types.js';
2
- /**
3
- * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`).
4
- * @returns a new structured patch which when applied will undo the original `patch`.
5
- */
6
- export declare function reversePatch(structuredPatch: StructuredPatch): StructuredPatch;
7
- export declare function reversePatch(structuredPatch: StructuredPatch[]): StructuredPatch[];
8
- export declare function reversePatch(structuredPatch: StructuredPatch | StructuredPatch[]): StructuredPatch | StructuredPatch[];
9
- //# sourceMappingURL=reverse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../src/patch/reverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,eAAe,EAAE,eAAe,GAAG,eAAe,CAAC;AAChF,wBAAgB,YAAY,CAAC,eAAe,EAAE,eAAe,EAAE,GAAG,eAAe,EAAE,CAAC;AACpF,wBAAgB,YAAY,CAAC,eAAe,EAAE,eAAe,GAAG,eAAe,EAAE,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC"}
@@ -1,23 +0,0 @@
1
- export function reversePatch(structuredPatch) {
2
- if (Array.isArray(structuredPatch)) {
3
- // (See comment in unixToWin for why we need the pointless-looking anonymous function here)
4
- return structuredPatch.map(patch => reversePatch(patch)).reverse();
5
- }
6
- return Object.assign(Object.assign({}, structuredPatch), { oldFileName: structuredPatch.newFileName, oldHeader: structuredPatch.newHeader, newFileName: structuredPatch.oldFileName, newHeader: structuredPatch.oldHeader, hunks: structuredPatch.hunks.map(hunk => {
7
- return {
8
- oldLines: hunk.newLines,
9
- oldStart: hunk.newStart,
10
- newLines: hunk.oldLines,
11
- newStart: hunk.oldStart,
12
- lines: hunk.lines.map(l => {
13
- if (l.startsWith('-')) {
14
- return `+${l.slice(1)}`;
15
- }
16
- if (l.startsWith('+')) {
17
- return `-${l.slice(1)}`;
18
- }
19
- return l;
20
- })
21
- };
22
- }) });
23
- }
@@ -1,213 +0,0 @@
1
- export interface ChangeObject<ValueT> {
2
- /**
3
- * The concatenated content of all the tokens represented by this change object - i.e. generally the text that is either added, deleted, or common, as a single string.
4
- * In cases where tokens are considered common but are non-identical (e.g. because an option like `ignoreCase` or a custom `comparator` was used), the value from the *new* string will be provided here.
5
- */
6
- value: ValueT;
7
- /**
8
- * true if the value was inserted into the new string, otherwise false
9
- */
10
- added: boolean;
11
- /**
12
- * true if the value was removed from the old string, otherwise false
13
- */
14
- removed: boolean;
15
- /**
16
- * How many tokens (e.g. chars for `diffChars`, lines for `diffLines`) the value in the change object consists of
17
- */
18
- count: number;
19
- }
20
- export type Change = ChangeObject<string>;
21
- export type ArrayChange = ChangeObject<any[]>;
22
- export interface CommonDiffOptions {
23
- /**
24
- * If `true`, the array of change objects returned will contain one change object per token (e.g. one per line if calling `diffLines`), instead of runs of consecutive tokens that are all added / all removed / all conserved being combined into a single change object.
25
- */
26
- oneChangePerToken?: boolean;
27
- }
28
- export interface TimeoutOption {
29
- /**
30
- * A number of milliseconds after which the diffing algorithm will abort and return `undefined`.
31
- * Supported by the same functions as `maxEditLength`.
32
- */
33
- timeout: number;
34
- }
35
- export interface MaxEditLengthOption {
36
- /**
37
- * A number specifying the maximum edit distance to consider between the old and new texts.
38
- * You can use this to limit the computational cost of diffing large, very different texts by giving up early if the cost will be huge.
39
- * This option can be passed either to diffing functions (`diffLines`, `diffChars`, etc) or to patch-creation function (`structuredPatch`, `createPatch`, etc), all of which will indicate that the max edit length was reached by returning `undefined` instead of whatever they'd normally return.
40
- */
41
- maxEditLength: number;
42
- }
43
- export type AbortableDiffOptions = TimeoutOption | MaxEditLengthOption;
44
- export type DiffCallbackNonabortable<T> = (result: ChangeObject<T>[]) => void;
45
- export type DiffCallbackAbortable<T> = (result: ChangeObject<T>[] | undefined) => void;
46
- export interface CallbackOptionNonabortable<T> {
47
- /**
48
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
49
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
50
- */
51
- callback: DiffCallbackNonabortable<T>;
52
- }
53
- export interface CallbackOptionAbortable<T> {
54
- /**
55
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
56
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
57
- */
58
- callback: DiffCallbackAbortable<T>;
59
- }
60
- interface DiffArraysOptions<T> extends CommonDiffOptions {
61
- comparator?: (a: T, b: T) => boolean;
62
- }
63
- export interface DiffArraysOptionsNonabortable<T> extends DiffArraysOptions<T> {
64
- /**
65
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
66
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
67
- */
68
- callback?: DiffCallbackNonabortable<T[]>;
69
- }
70
- export type DiffArraysOptionsAbortable<T> = DiffArraysOptions<T> & AbortableDiffOptions & Partial<CallbackOptionAbortable<T[]>>;
71
- interface DiffCharsOptions extends CommonDiffOptions {
72
- /**
73
- * If `true`, the uppercase and lowercase forms of a character are considered equal.
74
- * @default false
75
- */
76
- ignoreCase?: boolean;
77
- }
78
- export interface DiffCharsOptionsNonabortable extends DiffCharsOptions {
79
- /**
80
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
81
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
82
- */
83
- callback?: DiffCallbackNonabortable<string>;
84
- }
85
- export type DiffCharsOptionsAbortable = DiffCharsOptions & AbortableDiffOptions & Partial<CallbackOptionAbortable<string>>;
86
- interface DiffLinesOptions extends CommonDiffOptions {
87
- /**
88
- * `true` to remove all trailing CR (`\r`) characters before performing the diff.
89
- * This helps to get a useful diff when diffing UNIX text files against Windows text files.
90
- * @default false
91
- */
92
- stripTrailingCr?: boolean;
93
- /**
94
- * `true` to treat the newline character at the end of each line as its own token.
95
- * This allows for changes to the newline structure to occur independently of the line content and to be treated as such.
96
- * In general this is the more human friendly form of `diffLines`; the default behavior with this option turned off is better suited for patches and other computer friendly output.
97
- *
98
- * Note that while using `ignoreWhitespace` in combination with `newlineIsToken` is not an error, results may not be as expected.
99
- * With `ignoreWhitespace: true` and `newlineIsToken: false`, changing a completely empty line to contain some spaces is treated as a non-change, but with `ignoreWhitespace: true` and `newlineIsToken: true`, it is treated as an insertion.
100
- * This is because the content of a completely blank line is not a token at all in `newlineIsToken` mode.
101
- *
102
- * @default false
103
- */
104
- newlineIsToken?: boolean;
105
- /**
106
- * `true` to ignore a missing newline character at the end of the last line when comparing it to other lines.
107
- * (By default, the line `'b\n'` in text `'a\nb\nc'` is not considered equal to the line `'b'` in text `'a\nb'`; this option makes them be considered equal.)
108
- * Ignored if `ignoreWhitespace` or `newlineIsToken` are also true.
109
- * @default false
110
- */
111
- ignoreNewlineAtEof?: boolean;
112
- /**
113
- * `true` to ignore leading and trailing whitespace characters when checking if two lines are equal.
114
- * @default false
115
- */
116
- ignoreWhitespace?: boolean;
117
- }
118
- export interface DiffLinesOptionsNonabortable extends DiffLinesOptions {
119
- /**
120
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
121
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
122
- */
123
- callback?: DiffCallbackNonabortable<string>;
124
- }
125
- export type DiffLinesOptionsAbortable = DiffLinesOptions & AbortableDiffOptions & Partial<CallbackOptionAbortable<string>>;
126
- interface DiffWordsOptions extends CommonDiffOptions {
127
- /**
128
- * Same as in `diffChars`.
129
- * @default false
130
- */
131
- ignoreCase?: boolean;
132
- /**
133
- * An optional [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) object (which must have a `granularity` of `'word'`) for `diffWords` to use to split the text into words.
134
- *
135
- * Note that this is (deliberately) incorrectly typed as `any` to avoid users whose `lib` & `target` settings in tsconfig.json are older than es2022 getting type errors when they build about `Intl.Segmenter` not existing.
136
- * This is kind of ugly, since it makes the type declarations worse for users who genuinely use this feature, but seemed worth it to avoid the majority of the library's users (who probably do not use this particular option) getting confusing errors and being forced to change their `lib` to es2022 (even if their own code doesn't use any es2022 functions).
137
- *
138
- * By default, `diffWords` does not use an `Intl.Segmenter`, just some regexes for splitting text into words. This will tend to give worse results than `Intl.Segmenter` would, but ensures the results are consistent across environments; `Intl.Segmenter` behaviour is only loosely specced and the implementations in browsers could in principle change dramatically in future. If you want to use `diffWords` with an `Intl.Segmenter` but ensure it behaves the same whatever environment you run it in, use an `Intl.Segmenter` polyfill instead of the JavaScript engine's native `Intl.Segmenter` implementation.
139
- *
140
- * Using an `Intl.Segmenter` should allow better word-level diffing of non-English text than the default behaviour. For instance, `Intl.Segmenter`s can generally identify via built-in dictionaries which sequences of adjacent Chinese characters form words, allowing word-level diffing of Chinese. By specifying a language when instantiating the segmenter (e.g. `new Intl.Segmenter('sv', {granularity: 'word'})`) you can also support language-specific rules, like treating Swedish's colon separated contractions (like *k:a* for *kyrka*) as single words; by default this would be seen as two words separated by a colon.
141
- */
142
- intlSegmenter?: any;
143
- }
144
- export interface DiffWordsOptionsNonabortable extends DiffWordsOptions {
145
- /**
146
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
147
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
148
- */
149
- callback?: DiffCallbackNonabortable<string>;
150
- }
151
- export type DiffWordsOptionsAbortable = DiffWordsOptions & AbortableDiffOptions & Partial<CallbackOptionAbortable<string>>;
152
- interface DiffSentencesOptions extends CommonDiffOptions {
153
- }
154
- export interface DiffSentencesOptionsNonabortable extends DiffSentencesOptions {
155
- /**
156
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
157
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
158
- */
159
- callback?: DiffCallbackNonabortable<string>;
160
- }
161
- export type DiffSentencesOptionsAbortable = DiffSentencesOptions & AbortableDiffOptions & Partial<CallbackOptionAbortable<string>>;
162
- interface DiffJsonOptions extends CommonDiffOptions {
163
- /**
164
- * A value to replace `undefined` with. Ignored if a `stringifyReplacer` is provided.
165
- */
166
- undefinedReplacement?: any;
167
- /**
168
- * A custom replacer function.
169
- * Operates similarly to the `replacer` parameter to [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#the_replacer_parameter), but must be a function.
170
- */
171
- stringifyReplacer?: (k: string, v: any) => any;
172
- }
173
- export interface DiffJsonOptionsNonabortable extends DiffJsonOptions {
174
- /**
175
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
176
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
177
- */
178
- callback?: DiffCallbackNonabortable<string>;
179
- }
180
- export type DiffJsonOptionsAbortable = DiffJsonOptions & AbortableDiffOptions & Partial<CallbackOptionAbortable<string>>;
181
- interface DiffCssOptions extends CommonDiffOptions {
182
- }
183
- export interface DiffCssOptionsNonabortable extends DiffCssOptions {
184
- /**
185
- * If provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated.
186
- * The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument.
187
- */
188
- callback?: DiffCallbackNonabortable<string>;
189
- }
190
- export type DiffCssOptionsAbortable = DiffJsonOptions & AbortableDiffOptions & Partial<CallbackOptionAbortable<string>>;
191
- /**
192
- * Note that this contains the union of ALL options accepted by any of the built-in diffing
193
- * functions. The README notes which options are usable which functions. Using an option with a
194
- * diffing function that doesn't support it might yield unreasonable results.
195
- */
196
- export type AllDiffOptions = DiffArraysOptions<unknown> & DiffCharsOptions & DiffWordsOptions & DiffLinesOptions & DiffJsonOptions;
197
- export interface StructuredPatch {
198
- oldFileName: string;
199
- newFileName: string;
200
- oldHeader: string | undefined;
201
- newHeader: string | undefined;
202
- hunks: StructuredPatchHunk[];
203
- index?: string;
204
- }
205
- export interface StructuredPatchHunk {
206
- oldStart: number;
207
- oldLines: number;
208
- newStart: number;
209
- newLines: number;
210
- lines: string[];
211
- }
212
- export {};
213
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY,CAAC,MAAM;IAClC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,MAAM,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B;;;O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B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -1,3 +0,0 @@
1
- export declare function arrayEqual(a: any[], b: any[]): boolean;
2
- export declare function arrayStartsWith(array: any[], start: any[]): boolean;
3
- //# sourceMappingURL=array.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/util/array.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAMtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAYnE"}
@@ -1,17 +0,0 @@
1
- export function arrayEqual(a, b) {
2
- if (a.length !== b.length) {
3
- return false;
4
- }
5
- return arrayStartsWith(a, b);
6
- }
7
- export function arrayStartsWith(array, start) {
8
- if (start.length > array.length) {
9
- return false;
10
- }
11
- for (let i = 0; i < start.length; i++) {
12
- if (start[i] !== array[i]) {
13
- return false;
14
- }
15
- }
16
- return true;
17
- }
@@ -1,2 +0,0 @@
1
- export default function (start: number, minLine: number, maxLine: number): () => number | undefined;
2
- //# sourceMappingURL=distance-iterator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distance-iterator.d.ts","sourceRoot":"","sources":["../../src/util/distance-iterator.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,WAAU,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,MAAM,GAAG,SAAS,CA0CjG"}
@@ -1,37 +0,0 @@
1
- // Iterator that traverses in the range of [min, max], stepping
2
- // by distance from a given start position. I.e. for [0, 4], with
3
- // start of 2, this will iterate 2, 3, 1, 4, 0.
4
- export default function (start, minLine, maxLine) {
5
- let wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1;
6
- return function iterator() {
7
- if (wantForward && !forwardExhausted) {
8
- if (backwardExhausted) {
9
- localOffset++;
10
- }
11
- else {
12
- wantForward = false;
13
- }
14
- // Check if trying to fit beyond text length, and if not, check it fits
15
- // after offset location (or desired location on first iteration)
16
- if (start + localOffset <= maxLine) {
17
- return start + localOffset;
18
- }
19
- forwardExhausted = true;
20
- }
21
- if (!backwardExhausted) {
22
- if (!forwardExhausted) {
23
- wantForward = true;
24
- }
25
- // Check if trying to fit before text beginning, and if not, check it fits
26
- // before offset location
27
- if (minLine <= start - localOffset) {
28
- return start - localOffset++;
29
- }
30
- backwardExhausted = true;
31
- return iterator();
32
- }
33
- // We tried to fit hunk before text beginning and beyond text length, then
34
- // hunk can't fit on the text. Return undefined
35
- return undefined;
36
- };
37
- }
@@ -1,4 +0,0 @@
1
- export declare function generateOptions(options: {
2
- [key: string]: any;
3
- } | ((_: unknown) => void), defaults: any): object;
4
- //# sourceMappingURL=params.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/util/params.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAC7B,OAAO,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,EACtD,QAAQ,EAAE,GAAG,GACZ,MAAM,CAYR"}
@@ -1,14 +0,0 @@
1
- export function generateOptions(options, defaults) {
2
- if (typeof options === 'function') {
3
- defaults.callback = options;
4
- }
5
- else if (options) {
6
- for (const name in options) {
7
- /* istanbul ignore else */
8
- if (Object.prototype.hasOwnProperty.call(options, name)) {
9
- defaults[name] = options[name];
10
- }
11
- }
12
- }
13
- return defaults;
14
- }
@@ -1,18 +0,0 @@
1
- export declare function longestCommonPrefix(str1: string, str2: string): string;
2
- export declare function longestCommonSuffix(str1: string, str2: string): string;
3
- export declare function replacePrefix(string: string, oldPrefix: string, newPrefix: string): string;
4
- export declare function replaceSuffix(string: string, oldSuffix: string, newSuffix: string): string;
5
- export declare function removePrefix(string: string, oldPrefix: string): string;
6
- export declare function removeSuffix(string: string, oldSuffix: string): string;
7
- export declare function maximumOverlap(string1: string, string2: string): string;
8
- /**
9
- * Returns true if the string consistently uses Windows line endings.
10
- */
11
- export declare function hasOnlyWinLineEndings(string: string): boolean;
12
- /**
13
- * Returns true if the string consistently uses Unix line endings.
14
- */
15
- export declare function hasOnlyUnixLineEndings(string: string): boolean;
16
- export declare function trailingWs(string: string): string;
17
- export declare function leadingWs(string: string): string;
18
- //# sourceMappingURL=string.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/util/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBtE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAK1F;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS1F;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AAkCD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmBjD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIhD"}