@eggjs/mock 6.1.0-beta.3 → 6.1.0-beta.5
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.
- package/dist/_virtual/rolldown_runtime.js +24 -1
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/index.js +0 -1
- package/dist/inject_mocha.d.ts +1 -0
- package/dist/inject_mocha.js +35 -0
- package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +142 -0
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +157 -0
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +97 -0
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +40 -0
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +812 -0
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +50 -0
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +68 -0
- package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +752 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +203 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +209 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +18 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +215 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +24 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +33 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +29 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +185 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +23 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +26 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +83 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +51 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +26 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +151 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +178 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +168 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +301 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +137 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +367 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +91 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +99 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +23 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +30 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +22 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +97 -0
- package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +14 -0
- package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +16 -0
- package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +4093 -0
- package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +14 -0
- package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +27 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +12 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +83 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +35 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +392 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +86 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +104 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +99 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +65 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +18 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +95 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +105 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +1037 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +24 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +152 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +74 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +22 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +329 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +314 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +22 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +417 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +79 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +75 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +283 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +40 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +90 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +145 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +107 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +77 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +106 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +57 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +233 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +92 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +91 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +261 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +166 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +346 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +922 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +72 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +517 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +105 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +505 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +225 -0
- package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +124 -0
- package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +11 -0
- package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +114 -0
- package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +76 -0
- package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +89 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Pool.js +366 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +248 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +419 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +27 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +18 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +16 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +63 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +21 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +9 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +277 -0
- package/dist/register.d.ts +0 -2
- package/dist/register.js +1 -26
- package/package.json +10 -8
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js
|
|
5
|
+
var require_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffArrays = diffArrays;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var arrayDiff = exports.arrayDiff = new _base["default"]();
|
|
15
|
+
arrayDiff.tokenize = function(value) {
|
|
16
|
+
return value.slice();
|
|
17
|
+
};
|
|
18
|
+
arrayDiff.join = arrayDiff.removeEmpty = function(value) {
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
function diffArrays(oldArr, newArr, callback) {
|
|
22
|
+
return arrayDiff.diff(oldArr, newArr, callback);
|
|
23
|
+
}
|
|
24
|
+
}) });
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export default require_array();
|
|
28
|
+
|
|
29
|
+
export { require_array };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js
|
|
4
|
+
var require_base = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports["default"] = Diff;
|
|
7
|
+
/*istanbul ignore end*/
|
|
8
|
+
function Diff() {}
|
|
9
|
+
Diff.prototype = {
|
|
10
|
+
diff: function diff(oldString, newString) {
|
|
11
|
+
/*istanbul ignore start*/
|
|
12
|
+
var _options$timeout;
|
|
13
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
14
|
+
var callback = options.callback;
|
|
15
|
+
if (typeof options === "function") {
|
|
16
|
+
callback = options;
|
|
17
|
+
options = {};
|
|
18
|
+
}
|
|
19
|
+
var self = this;
|
|
20
|
+
function done(value) {
|
|
21
|
+
value = self.postProcess(value, options);
|
|
22
|
+
if (callback) {
|
|
23
|
+
setTimeout(function() {
|
|
24
|
+
callback(value);
|
|
25
|
+
}, 0);
|
|
26
|
+
return true;
|
|
27
|
+
} else return value;
|
|
28
|
+
}
|
|
29
|
+
oldString = this.castInput(oldString, options);
|
|
30
|
+
newString = this.castInput(newString, options);
|
|
31
|
+
oldString = this.removeEmpty(this.tokenize(oldString, options));
|
|
32
|
+
newString = this.removeEmpty(this.tokenize(newString, options));
|
|
33
|
+
var newLen = newString.length, oldLen = oldString.length;
|
|
34
|
+
var editLength = 1;
|
|
35
|
+
var maxEditLength = newLen + oldLen;
|
|
36
|
+
if (options.maxEditLength != null) maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
|
37
|
+
var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
|
38
|
+
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
|
39
|
+
var bestPath = [{
|
|
40
|
+
oldPos: -1,
|
|
41
|
+
lastComponent: void 0
|
|
42
|
+
}];
|
|
43
|
+
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options);
|
|
44
|
+
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
|
|
45
|
+
var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
|
|
46
|
+
function execEditLength() {
|
|
47
|
+
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
|
48
|
+
var basePath = void 0;
|
|
49
|
+
var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
|
|
50
|
+
if (removePath) bestPath[diagonalPath - 1] = void 0;
|
|
51
|
+
var canAdd = false;
|
|
52
|
+
if (addPath) {
|
|
53
|
+
var addPathNewPos = addPath.oldPos - diagonalPath;
|
|
54
|
+
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
|
55
|
+
}
|
|
56
|
+
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
|
57
|
+
if (!canAdd && !canRemove) {
|
|
58
|
+
bestPath[diagonalPath] = void 0;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) basePath = self.addToPath(addPath, true, false, 0, options);
|
|
62
|
+
else basePath = self.addToPath(removePath, false, true, 1, options);
|
|
63
|
+
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options);
|
|
64
|
+
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
|
65
|
+
else {
|
|
66
|
+
bestPath[diagonalPath] = basePath;
|
|
67
|
+
if (basePath.oldPos + 1 >= oldLen) maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
|
68
|
+
if (newPos + 1 >= newLen) minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
editLength++;
|
|
72
|
+
}
|
|
73
|
+
if (callback) (function exec() {
|
|
74
|
+
setTimeout(function() {
|
|
75
|
+
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) return callback();
|
|
76
|
+
if (!execEditLength()) exec();
|
|
77
|
+
}, 0);
|
|
78
|
+
})();
|
|
79
|
+
else while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
|
80
|
+
var ret = execEditLength();
|
|
81
|
+
if (ret) return ret;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
addToPath: function addToPath(path, added, removed, oldPosInc, options) {
|
|
85
|
+
var last = path.lastComponent;
|
|
86
|
+
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) return {
|
|
87
|
+
oldPos: path.oldPos + oldPosInc,
|
|
88
|
+
lastComponent: {
|
|
89
|
+
count: last.count + 1,
|
|
90
|
+
added,
|
|
91
|
+
removed,
|
|
92
|
+
previousComponent: last.previousComponent
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
else return {
|
|
96
|
+
oldPos: path.oldPos + oldPosInc,
|
|
97
|
+
lastComponent: {
|
|
98
|
+
count: 1,
|
|
99
|
+
added,
|
|
100
|
+
removed,
|
|
101
|
+
previousComponent: last
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) {
|
|
106
|
+
var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
|
|
107
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) {
|
|
108
|
+
newPos++;
|
|
109
|
+
oldPos++;
|
|
110
|
+
commonCount++;
|
|
111
|
+
if (options.oneChangePerToken) basePath.lastComponent = {
|
|
112
|
+
count: 1,
|
|
113
|
+
previousComponent: basePath.lastComponent,
|
|
114
|
+
added: false,
|
|
115
|
+
removed: false
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (commonCount && !options.oneChangePerToken) basePath.lastComponent = {
|
|
119
|
+
count: commonCount,
|
|
120
|
+
previousComponent: basePath.lastComponent,
|
|
121
|
+
added: false,
|
|
122
|
+
removed: false
|
|
123
|
+
};
|
|
124
|
+
basePath.oldPos = oldPos;
|
|
125
|
+
return newPos;
|
|
126
|
+
},
|
|
127
|
+
equals: function equals(left, right, options) {
|
|
128
|
+
if (options.comparator) return options.comparator(left, right);
|
|
129
|
+
else return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
|
130
|
+
},
|
|
131
|
+
removeEmpty: function removeEmpty(array) {
|
|
132
|
+
var ret = [];
|
|
133
|
+
for (var i = 0; i < array.length; i++) if (array[i]) ret.push(array[i]);
|
|
134
|
+
return ret;
|
|
135
|
+
},
|
|
136
|
+
castInput: function castInput(value) {
|
|
137
|
+
return value;
|
|
138
|
+
},
|
|
139
|
+
tokenize: function tokenize(value) {
|
|
140
|
+
return Array.from(value);
|
|
141
|
+
},
|
|
142
|
+
join: function join(chars) {
|
|
143
|
+
return chars.join("");
|
|
144
|
+
},
|
|
145
|
+
postProcess: function postProcess(changeObjects) {
|
|
146
|
+
return changeObjects;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
|
150
|
+
var components = [];
|
|
151
|
+
var nextComponent;
|
|
152
|
+
while (lastComponent) {
|
|
153
|
+
components.push(lastComponent);
|
|
154
|
+
nextComponent = lastComponent.previousComponent;
|
|
155
|
+
delete lastComponent.previousComponent;
|
|
156
|
+
lastComponent = nextComponent;
|
|
157
|
+
}
|
|
158
|
+
components.reverse();
|
|
159
|
+
var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
|
|
160
|
+
for (; componentPos < componentLen; componentPos++) {
|
|
161
|
+
var component = components[componentPos];
|
|
162
|
+
if (!component.removed) {
|
|
163
|
+
if (!component.added && useLongestToken) {
|
|
164
|
+
var value = newString.slice(newPos, newPos + component.count);
|
|
165
|
+
value = value.map(function(value$1, i) {
|
|
166
|
+
var oldValue = oldString[oldPos + i];
|
|
167
|
+
return oldValue.length > value$1.length ? oldValue : value$1;
|
|
168
|
+
});
|
|
169
|
+
component.value = diff.join(value);
|
|
170
|
+
} else component.value = diff.join(newString.slice(newPos, newPos + component.count));
|
|
171
|
+
newPos += component.count;
|
|
172
|
+
if (!component.added) oldPos += component.count;
|
|
173
|
+
} else {
|
|
174
|
+
component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
|
|
175
|
+
oldPos += component.count;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return components;
|
|
179
|
+
}
|
|
180
|
+
}) });
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
export default require_base();
|
|
184
|
+
|
|
185
|
+
export { require_base };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js
|
|
5
|
+
var require_character = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffChars = diffChars;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var characterDiff = exports.characterDiff = new _base["default"]();
|
|
15
|
+
function diffChars(oldStr, newStr, options) {
|
|
16
|
+
return characterDiff.diff(oldStr, newStr, options);
|
|
17
|
+
}
|
|
18
|
+
}) });
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export default require_character();
|
|
22
|
+
|
|
23
|
+
export { require_character };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js
|
|
5
|
+
var require_css = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffCss = diffCss;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var cssDiff = exports.cssDiff = new _base["default"]();
|
|
15
|
+
cssDiff.tokenize = function(value) {
|
|
16
|
+
return value.split(/([{}:;,]|\s+)/);
|
|
17
|
+
};
|
|
18
|
+
function diffCss(oldStr, newStr, callback) {
|
|
19
|
+
return cssDiff.diff(oldStr, newStr, callback);
|
|
20
|
+
}
|
|
21
|
+
}) });
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export default require_css();
|
|
25
|
+
|
|
26
|
+
export { require_css };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
import { require_line } from "./line.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js
|
|
6
|
+
var require_json = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js": ((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.canonicalize = canonicalize;
|
|
9
|
+
exports.diffJson = diffJson;
|
|
10
|
+
/*istanbul ignore end*/
|
|
11
|
+
var _base = _interopRequireDefault(require_base());
|
|
12
|
+
var _line = require_line();
|
|
13
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
15
|
+
}
|
|
16
|
+
function _typeof(o) {
|
|
17
|
+
"@babel/helpers - typeof";
|
|
18
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
19
|
+
return typeof o$1;
|
|
20
|
+
} : function(o$1) {
|
|
21
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
22
|
+
}, _typeof(o);
|
|
23
|
+
}
|
|
24
|
+
/*istanbul ignore end*/
|
|
25
|
+
var jsonDiff = exports.jsonDiff = new _base["default"]();
|
|
26
|
+
jsonDiff.useLongestToken = true;
|
|
27
|
+
jsonDiff.tokenize = _line.lineDiff.tokenize;
|
|
28
|
+
jsonDiff.castInput = function(value, options) {
|
|
29
|
+
var undefinedReplacement = options.undefinedReplacement, _options$stringifyRep = options.stringifyReplacer, stringifyReplacer = _options$stringifyRep === void 0 ? function(k, v) {
|
|
30
|
+
return typeof v === "undefined" ? undefinedReplacement : v;
|
|
31
|
+
} : _options$stringifyRep;
|
|
32
|
+
return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " ");
|
|
33
|
+
};
|
|
34
|
+
jsonDiff.equals = function(left, right, options) {
|
|
35
|
+
return _base["default"].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options);
|
|
36
|
+
};
|
|
37
|
+
function diffJson(oldObj, newObj, options) {
|
|
38
|
+
return jsonDiff.diff(oldObj, newObj, options);
|
|
39
|
+
}
|
|
40
|
+
function canonicalize(obj, stack, replacementStack, replacer, key) {
|
|
41
|
+
stack = stack || [];
|
|
42
|
+
replacementStack = replacementStack || [];
|
|
43
|
+
if (replacer) obj = replacer(key, obj);
|
|
44
|
+
var i;
|
|
45
|
+
for (i = 0; i < stack.length; i += 1) if (stack[i] === obj) return replacementStack[i];
|
|
46
|
+
var canonicalizedObj;
|
|
47
|
+
if ("[object Array]" === Object.prototype.toString.call(obj)) {
|
|
48
|
+
stack.push(obj);
|
|
49
|
+
canonicalizedObj = new Array(obj.length);
|
|
50
|
+
replacementStack.push(canonicalizedObj);
|
|
51
|
+
for (i = 0; i < obj.length; i += 1) canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
|
|
52
|
+
stack.pop();
|
|
53
|
+
replacementStack.pop();
|
|
54
|
+
return canonicalizedObj;
|
|
55
|
+
}
|
|
56
|
+
if (obj && obj.toJSON) obj = obj.toJSON();
|
|
57
|
+
if (_typeof(
|
|
58
|
+
/*istanbul ignore end*/
|
|
59
|
+
obj
|
|
60
|
+
) === "object" && obj !== null) {
|
|
61
|
+
stack.push(obj);
|
|
62
|
+
canonicalizedObj = {};
|
|
63
|
+
replacementStack.push(canonicalizedObj);
|
|
64
|
+
var sortedKeys = [], _key;
|
|
65
|
+
for (_key in obj)
|
|
66
|
+
/* istanbul ignore else */
|
|
67
|
+
if (Object.prototype.hasOwnProperty.call(obj, _key)) sortedKeys.push(_key);
|
|
68
|
+
sortedKeys.sort();
|
|
69
|
+
for (i = 0; i < sortedKeys.length; i += 1) {
|
|
70
|
+
_key = sortedKeys[i];
|
|
71
|
+
canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
|
|
72
|
+
}
|
|
73
|
+
stack.pop();
|
|
74
|
+
replacementStack.pop();
|
|
75
|
+
} else canonicalizedObj = obj;
|
|
76
|
+
return canonicalizedObj;
|
|
77
|
+
}
|
|
78
|
+
}) });
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export default require_json();
|
|
82
|
+
|
|
83
|
+
export { require_json };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
import { require_params } from "../util/params.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js
|
|
6
|
+
var require_line = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js": ((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.diffLines = diffLines;
|
|
9
|
+
exports.diffTrimmedLines = diffTrimmedLines;
|
|
10
|
+
/*istanbul ignore end*/
|
|
11
|
+
var _base = _interopRequireDefault(require_base());
|
|
12
|
+
var _params = require_params();
|
|
13
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
15
|
+
}
|
|
16
|
+
/*istanbul ignore end*/
|
|
17
|
+
var lineDiff = exports.lineDiff = new _base["default"]();
|
|
18
|
+
lineDiff.tokenize = function(value, options) {
|
|
19
|
+
if (options.stripTrailingCr) value = value.replace(/\r\n/g, "\n");
|
|
20
|
+
var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
|
|
21
|
+
if (!linesAndNewlines[linesAndNewlines.length - 1]) linesAndNewlines.pop();
|
|
22
|
+
for (var i = 0; i < linesAndNewlines.length; i++) {
|
|
23
|
+
var line = linesAndNewlines[i];
|
|
24
|
+
if (i % 2 && !options.newlineIsToken) retLines[retLines.length - 1] += line;
|
|
25
|
+
else retLines.push(line);
|
|
26
|
+
}
|
|
27
|
+
return retLines;
|
|
28
|
+
};
|
|
29
|
+
lineDiff.equals = function(left, right, options) {
|
|
30
|
+
if (options.ignoreWhitespace) {
|
|
31
|
+
if (!options.newlineIsToken || !left.includes("\n")) left = left.trim();
|
|
32
|
+
if (!options.newlineIsToken || !right.includes("\n")) right = right.trim();
|
|
33
|
+
} else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
|
|
34
|
+
if (left.endsWith("\n")) left = left.slice(0, -1);
|
|
35
|
+
if (right.endsWith("\n")) right = right.slice(0, -1);
|
|
36
|
+
}
|
|
37
|
+
return _base["default"].prototype.equals.call(this, left, right, options);
|
|
38
|
+
};
|
|
39
|
+
function diffLines(oldStr, newStr, callback) {
|
|
40
|
+
return lineDiff.diff(oldStr, newStr, callback);
|
|
41
|
+
}
|
|
42
|
+
function diffTrimmedLines(oldStr, newStr, callback) {
|
|
43
|
+
var options = (0, _params.generateOptions)(callback, { ignoreWhitespace: true });
|
|
44
|
+
return lineDiff.diff(oldStr, newStr, options);
|
|
45
|
+
}
|
|
46
|
+
}) });
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export default require_line();
|
|
50
|
+
|
|
51
|
+
export { require_line };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js
|
|
5
|
+
var require_sentence = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffSentences = diffSentences;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var sentenceDiff = exports.sentenceDiff = new _base["default"]();
|
|
15
|
+
sentenceDiff.tokenize = function(value) {
|
|
16
|
+
return value.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
17
|
+
};
|
|
18
|
+
function diffSentences(oldStr, newStr, callback) {
|
|
19
|
+
return sentenceDiff.diff(oldStr, newStr, callback);
|
|
20
|
+
}
|
|
21
|
+
}) });
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export default require_sentence();
|
|
25
|
+
|
|
26
|
+
export { require_sentence };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
import { require_string } from "../util/string.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js
|
|
6
|
+
var require_word = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js": ((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.diffWords = diffWords;
|
|
9
|
+
exports.diffWordsWithSpace = diffWordsWithSpace;
|
|
10
|
+
/*istanbul ignore end*/
|
|
11
|
+
var _base = _interopRequireDefault(require_base());
|
|
12
|
+
var _string = require_string();
|
|
13
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
15
|
+
}
|
|
16
|
+
/*istanbul ignore end*/
|
|
17
|
+
var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
|
|
18
|
+
var tokenizeIncludingWhitespace = new RegExp(
|
|
19
|
+
/*istanbul ignore start*/
|
|
20
|
+
"[".concat(
|
|
21
|
+
/*istanbul ignore end*/
|
|
22
|
+
extendedWordChars,
|
|
23
|
+
"]+|\\s+|[^"
|
|
24
|
+
).concat(extendedWordChars, "]"),
|
|
25
|
+
"ug"
|
|
26
|
+
);
|
|
27
|
+
var wordDiff = exports.wordDiff = new _base["default"]();
|
|
28
|
+
wordDiff.equals = function(left, right, options) {
|
|
29
|
+
if (options.ignoreCase) {
|
|
30
|
+
left = left.toLowerCase();
|
|
31
|
+
right = right.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
return left.trim() === right.trim();
|
|
34
|
+
};
|
|
35
|
+
wordDiff.tokenize = function(value) {
|
|
36
|
+
/*istanbul ignore start*/
|
|
37
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
38
|
+
var parts;
|
|
39
|
+
if (options.intlSegmenter) {
|
|
40
|
+
if (options.intlSegmenter.resolvedOptions().granularity != "word") throw new Error("The segmenter passed must have a granularity of \"word\"");
|
|
41
|
+
parts = Array.from(options.intlSegmenter.segment(value), function(segment) {
|
|
42
|
+
return segment.segment;
|
|
43
|
+
});
|
|
44
|
+
} else parts = value.match(tokenizeIncludingWhitespace) || [];
|
|
45
|
+
var tokens = [];
|
|
46
|
+
var prevPart = null;
|
|
47
|
+
parts.forEach(function(part) {
|
|
48
|
+
if (/\s/.test(part)) if (prevPart == null) tokens.push(part);
|
|
49
|
+
else tokens.push(tokens.pop() + part);
|
|
50
|
+
else if (/\s/.test(prevPart)) if (tokens[tokens.length - 1] == prevPart) tokens.push(tokens.pop() + part);
|
|
51
|
+
else tokens.push(prevPart + part);
|
|
52
|
+
else tokens.push(part);
|
|
53
|
+
prevPart = part;
|
|
54
|
+
});
|
|
55
|
+
return tokens;
|
|
56
|
+
};
|
|
57
|
+
wordDiff.join = function(tokens) {
|
|
58
|
+
return tokens.map(function(token, i) {
|
|
59
|
+
if (i == 0) return token;
|
|
60
|
+
else return token.replace(/^\s+/, "");
|
|
61
|
+
}).join("");
|
|
62
|
+
};
|
|
63
|
+
wordDiff.postProcess = function(changes, options) {
|
|
64
|
+
if (!changes || options.oneChangePerToken) return changes;
|
|
65
|
+
var lastKeep = null;
|
|
66
|
+
var insertion = null;
|
|
67
|
+
var deletion = null;
|
|
68
|
+
changes.forEach(function(change) {
|
|
69
|
+
if (change.added) insertion = change;
|
|
70
|
+
else if (change.removed) deletion = change;
|
|
71
|
+
else {
|
|
72
|
+
if (insertion || deletion) dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
|
|
73
|
+
lastKeep = change;
|
|
74
|
+
insertion = null;
|
|
75
|
+
deletion = null;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
if (insertion || deletion) dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
|
|
79
|
+
return changes;
|
|
80
|
+
};
|
|
81
|
+
function diffWords(oldStr, newStr, options) {
|
|
82
|
+
if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) return diffWordsWithSpace(oldStr, newStr, options);
|
|
83
|
+
return wordDiff.diff(oldStr, newStr, options);
|
|
84
|
+
}
|
|
85
|
+
function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
|
|
86
|
+
if (deletion && insertion) {
|
|
87
|
+
var oldWsPrefix = deletion.value.match(/^\s*/)[0];
|
|
88
|
+
var oldWsSuffix = deletion.value.match(/\s*$/)[0];
|
|
89
|
+
var newWsPrefix = insertion.value.match(/^\s*/)[0];
|
|
90
|
+
var newWsSuffix = insertion.value.match(/\s*$/)[0];
|
|
91
|
+
if (startKeep) {
|
|
92
|
+
var commonWsPrefix = (0, _string.longestCommonPrefix)(oldWsPrefix, newWsPrefix);
|
|
93
|
+
startKeep.value = (0, _string.replaceSuffix)(startKeep.value, newWsPrefix, commonWsPrefix);
|
|
94
|
+
deletion.value = (0, _string.removePrefix)(deletion.value, commonWsPrefix);
|
|
95
|
+
insertion.value = (0, _string.removePrefix)(insertion.value, commonWsPrefix);
|
|
96
|
+
}
|
|
97
|
+
if (endKeep) {
|
|
98
|
+
var commonWsSuffix = (0, _string.longestCommonSuffix)(oldWsSuffix, newWsSuffix);
|
|
99
|
+
endKeep.value = (0, _string.replacePrefix)(endKeep.value, newWsSuffix, commonWsSuffix);
|
|
100
|
+
deletion.value = (0, _string.removeSuffix)(deletion.value, commonWsSuffix);
|
|
101
|
+
insertion.value = (0, _string.removeSuffix)(insertion.value, commonWsSuffix);
|
|
102
|
+
}
|
|
103
|
+
} else if (insertion) {
|
|
104
|
+
if (startKeep) insertion.value = insertion.value.replace(/^\s*/, "");
|
|
105
|
+
if (endKeep) endKeep.value = endKeep.value.replace(/^\s*/, "");
|
|
106
|
+
} else if (startKeep && endKeep) {
|
|
107
|
+
var newWsFull = endKeep.value.match(/^\s*/)[0], delWsStart = deletion.value.match(/^\s*/)[0], delWsEnd = deletion.value.match(/\s*$/)[0];
|
|
108
|
+
var newWsStart = (0, _string.longestCommonPrefix)(newWsFull, delWsStart);
|
|
109
|
+
deletion.value = (0, _string.removePrefix)(deletion.value, newWsStart);
|
|
110
|
+
var newWsEnd = (0, _string.longestCommonSuffix)(
|
|
111
|
+
/*istanbul ignore start*/
|
|
112
|
+
(0, _string.removePrefix)(newWsFull, newWsStart),
|
|
113
|
+
delWsEnd
|
|
114
|
+
);
|
|
115
|
+
deletion.value = (0, _string.removeSuffix)(deletion.value, newWsEnd);
|
|
116
|
+
endKeep.value = (0, _string.replacePrefix)(endKeep.value, newWsFull, newWsEnd);
|
|
117
|
+
startKeep.value = (0, _string.replaceSuffix)(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
|
|
118
|
+
} else if (endKeep) {
|
|
119
|
+
var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
|
|
120
|
+
var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
|
|
121
|
+
var overlap = (0, _string.maximumOverlap)(deletionWsSuffix, endKeepWsPrefix);
|
|
122
|
+
deletion.value = (0, _string.removeSuffix)(deletion.value, overlap);
|
|
123
|
+
} else if (startKeep) {
|
|
124
|
+
var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
|
|
125
|
+
var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
|
|
126
|
+
var _overlap = (0, _string.maximumOverlap)(startKeepWsSuffix, deletionWsPrefix);
|
|
127
|
+
deletion.value = (0, _string.removePrefix)(deletion.value, _overlap);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
var wordWithSpaceDiff = exports.wordWithSpaceDiff = new _base["default"]();
|
|
131
|
+
wordWithSpaceDiff.tokenize = function(value) {
|
|
132
|
+
var regex = new RegExp(
|
|
133
|
+
/*istanbul ignore start*/
|
|
134
|
+
"(\\r?\\n)|[".concat(
|
|
135
|
+
/*istanbul ignore end*/
|
|
136
|
+
extendedWordChars,
|
|
137
|
+
"]+|[^\\S\\n\\r]+|[^"
|
|
138
|
+
).concat(extendedWordChars, "]"),
|
|
139
|
+
"ug"
|
|
140
|
+
);
|
|
141
|
+
return value.match(regex) || [];
|
|
142
|
+
};
|
|
143
|
+
function diffWordsWithSpace(oldStr, newStr, options) {
|
|
144
|
+
return wordWithSpaceDiff.diff(oldStr, newStr, options);
|
|
145
|
+
}
|
|
146
|
+
}) });
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
export default require_word();
|
|
150
|
+
|
|
151
|
+
export { require_word };
|