@allahjs/utils 1.11.0 → 1.12.0

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 (50) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/core/diffUtils/index.cjs +219 -0
  3. package/dist/core/diffUtils/index.cjs.map +1 -0
  4. package/dist/core/diffUtils/index.d.ts +32 -0
  5. package/dist/core/fileUtils/index.cjs +21 -0
  6. package/dist/core/fileUtils/index.cjs.map +1 -0
  7. package/dist/core/fileUtils/index.d.ts +10 -0
  8. package/dist/core/index.cjs +20 -10
  9. package/dist/core/index.cjs.map +1 -1
  10. package/dist/core/index.d.ts +43 -0
  11. package/dist/esm/core/diffUtils/index.d.ts +32 -0
  12. package/dist/esm/core/diffUtils/index.js +215 -0
  13. package/dist/esm/core/diffUtils/index.js.map +1 -0
  14. package/dist/esm/core/fileUtils/index.d.ts +10 -0
  15. package/dist/esm/core/fileUtils/index.js +16 -0
  16. package/dist/esm/core/fileUtils/index.js.map +1 -0
  17. package/dist/esm/core/index.d.ts +43 -0
  18. package/dist/esm/core/index.js +10 -0
  19. package/dist/esm/core/index.js.map +1 -1
  20. package/dist/esm/index.d.ts +5 -0
  21. package/dist/esm/index.js +5 -0
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.js +20 -0
  24. package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.js.map +1 -0
  25. package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js +256 -0
  26. package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js.map +1 -0
  27. package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js +11 -0
  28. package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js.map +1 -0
  29. package/dist/esm/request/ReqQueue/index.d.ts +25 -0
  30. package/dist/esm/request/httpCode/index.d.ts +9 -0
  31. package/dist/esm/request/index.d.ts +3 -0
  32. package/dist/esm/request/index.js +4 -2
  33. package/dist/esm/request/index.js.map +1 -1
  34. package/dist/esm/request/uniRequest/index.d.ts +5 -0
  35. package/dist/index.cjs +61 -50
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.ts +5 -0
  38. package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.cjs +23 -0
  39. package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.cjs.map +1 -0
  40. package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.cjs +260 -0
  41. package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.cjs.map +1 -0
  42. package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.cjs +14 -0
  43. package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.cjs.map +1 -0
  44. package/dist/request/ReqQueue/index.d.ts +25 -0
  45. package/dist/request/httpCode/index.d.ts +9 -0
  46. package/dist/request/index.cjs +25 -20
  47. package/dist/request/index.cjs.map +1 -1
  48. package/dist/request/index.d.ts +3 -0
  49. package/dist/request/uniRequest/index.d.ts +5 -0
  50. package/package.json +16 -1
package/dist/index.cjs CHANGED
@@ -1,63 +1,70 @@
1
1
  'use strict';
2
2
 
3
- var index$g = require('./core/stringUtils/index.cjs');
4
- var index$1 = require('./core/arrayUtils/index.cjs');
5
- var index$e = require('./core/objectUtils/index.cjs');
6
- var index$9 = require('./core/dateUtils/index.cjs');
7
- var index$d = require('./core/numberUtils/index.cjs');
8
- var index$i = require('./core/validationUtils/index.cjs');
9
- var index$2 = require('./core/asyncUtils/index.cjs');
10
- var index$4 = require('./core/colorUtils/index.cjs');
11
- var index$8 = require('./core/cryptoUtils/index.cjs');
12
- var index$b = require('./core/pageUtils/index.cjs');
13
- var index$f = require('./core/storageUtils/index.cjs');
14
- var index$5 = require('./core/constants/index.cjs');
15
- var index$c = require('./browser/domUtils/index.cjs');
16
- var index$6 = require('./browser/cookieUtils/index.cjs');
17
- var index$h = require('./browser/urlUtils/index.cjs');
3
+ var index$k = require('./core/stringUtils/index.cjs');
4
+ var index$2 = require('./core/arrayUtils/index.cjs');
5
+ var index$i = require('./core/objectUtils/index.cjs');
6
+ var index$b = require('./core/dateUtils/index.cjs');
7
+ var index$h = require('./core/numberUtils/index.cjs');
8
+ var index$n = require('./core/validationUtils/index.cjs');
9
+ var index$3 = require('./core/asyncUtils/index.cjs');
10
+ var index$6 = require('./core/colorUtils/index.cjs');
11
+ var index$a = require('./core/cryptoUtils/index.cjs');
12
+ var index$d = require('./core/pageUtils/index.cjs');
13
+ var index$e = require('./core/diffUtils/index.cjs');
14
+ var index$g = require('./core/fileUtils/index.cjs');
15
+ var index$j = require('./core/storageUtils/index.cjs');
16
+ var index$7 = require('./core/constants/index.cjs');
17
+ var index$f = require('./browser/domUtils/index.cjs');
18
+ var index$8 = require('./browser/cookieUtils/index.cjs');
19
+ var index$m = require('./browser/urlUtils/index.cjs');
18
20
  var request_index = require('./request/index.cjs');
19
- var index$7 = require('./uniapp/uniUtils/index.cjs');
21
+ var index$9 = require('./uniapp/uniUtils/index.cjs');
20
22
  var index = require('./uniapp/Tips/index.cjs');
21
- var index$3 = require('./uniapp/cloudUtils/index.cjs');
23
+ var index$4 = require('./uniapp/cloudUtils/index.cjs');
22
24
  var initialUmiState = require('./umijs/initialUmiState.cjs');
23
- var index$a = require('./types/data/index.cjs');
25
+ var index$c = require('./types/data/index.cjs');
26
+ var index$1 = require('./request/ReqQueue/index.cjs');
27
+ var index$l = require('./request/uniRequest/index.cjs');
28
+ var index$5 = require('./request/httpCode/index.cjs');
24
29
 
25
30
  // 主入口文件 - 导出所有工具函数
26
31
  // 核心工具函数(适用于 Node.js、UniApp、React Native 等)
27
32
  // 版本信息
28
33
  const version = '1.0.0';
29
34
 
30
- exports.stringUtils = index$g.default;
31
- exports.arrayUtils = index$1.default;
32
- exports.objectUtils = index$e.default;
33
- exports.dateUtils = index$9.default;
34
- exports.templateObj = index$9.templateObj;
35
- exports.numberUtils = index$d.default;
36
- exports.validationUtils = index$i.default;
37
- exports.asyncUtils = index$2.default;
38
- exports.colorUtils = index$4.default;
39
- exports.cryptoUtils = index$8.default;
40
- exports.defTableData = index$b.defTableData;
41
- exports.pageUtils = index$b.default;
42
- exports.storageUtils = index$f.default;
43
- exports.constants = index$5;
44
- exports.domUtils = index$c.default;
45
- exports.cookieUtils = index$6.default;
46
- exports.urlUtils = index$h.default;
35
+ exports.stringUtils = index$k.default;
36
+ exports.arrayUtils = index$2.default;
37
+ exports.objectUtils = index$i.default;
38
+ exports.dateUtils = index$b.default;
39
+ exports.templateObj = index$b.templateObj;
40
+ exports.numberUtils = index$h.default;
41
+ exports.validationUtils = index$n.default;
42
+ exports.asyncUtils = index$3.default;
43
+ exports.colorUtils = index$6.default;
44
+ exports.cryptoUtils = index$a.default;
45
+ exports.defTableData = index$d.defTableData;
46
+ exports.pageUtils = index$d.default;
47
+ exports.diffUtils = index$e.default;
48
+ exports.fileUtils = index$g.default;
49
+ exports.storageUtils = index$j.default;
50
+ exports.constants = index$7;
51
+ exports.domUtils = index$f.default;
52
+ exports.cookieUtils = index$8.default;
53
+ exports.urlUtils = index$m.default;
47
54
  exports.request = request_index.default;
48
- exports.createTimestampedData = index$7.createTimestampedData;
49
- exports.createUpdateData = index$7.createUpdateData;
50
- exports.deepClone = index$7.deepClone;
51
- exports.ensureArray = index$7.ensureArray;
52
- exports.findById = index$7.findById;
53
- exports.formatDate = index$7.formatDate;
54
- exports.formatRelativeTime = index$7.formatRelativeTime;
55
- exports.handleError = index$7.handleError;
56
- exports.handleSuccess = index$7.handleSuccess;
57
- exports.isDataExists = index$7.isDataExists;
58
- exports.isValidFamilyMember = index$7.isValidFamilyMember;
59
- exports.safeGetResponseData = index$7.safeGetResponseData;
60
- exports.validateRequiredFields = index$7.validateRequiredFields;
55
+ exports.createTimestampedData = index$9.createTimestampedData;
56
+ exports.createUpdateData = index$9.createUpdateData;
57
+ exports.deepClone = index$9.deepClone;
58
+ exports.ensureArray = index$9.ensureArray;
59
+ exports.findById = index$9.findById;
60
+ exports.formatDate = index$9.formatDate;
61
+ exports.formatRelativeTime = index$9.formatRelativeTime;
62
+ exports.handleError = index$9.handleError;
63
+ exports.handleSuccess = index$9.handleSuccess;
64
+ exports.isDataExists = index$9.isDataExists;
65
+ exports.isValidFamilyMember = index$9.isValidFamilyMember;
66
+ exports.safeGetResponseData = index$9.safeGetResponseData;
67
+ exports.validateRequiredFields = index$9.validateRequiredFields;
61
68
  exports.BatchOperationTips = index.BatchOperationTips;
62
69
  exports.Tips = index.Tips;
63
70
  Object.defineProperty(exports, "ToastPosition", {
@@ -88,13 +95,17 @@ exports.showSuccessToastWithCallback = index.showSuccessToastWithCallback;
88
95
  exports.showToast = index.showToast;
89
96
  exports.showUpdateDialog = index.showUpdateDialog;
90
97
  exports.showWarningToast = index.showWarningToast;
91
- exports.cloudUtils = index$3.cloudUtils;
98
+ exports.cloudUtils = index$4.cloudUtils;
92
99
  exports.buildLoginPath = initialUmiState.buildLoginPath;
93
100
  exports.getJwtToken = initialUmiState.getJwtToken;
94
101
  exports.initialUmiState = initialUmiState.initialUmiState;
95
102
  exports.isLogin = initialUmiState.isLogin;
96
103
  exports.loginOk = initialUmiState.loginOk;
97
104
  exports.toLogin = initialUmiState.toLogin;
98
- exports.defBaseFilter = index$a.defBaseFilter;
105
+ exports.defBaseFilter = index$c.defBaseFilter;
106
+ exports.ReqQueue = index$1.default;
107
+ exports.uniRequest = index$l.default;
108
+ exports.codeMessage = index$5.codeMessage;
109
+ exports.defOption = index$5.defOption;
99
110
  exports.version = version;
100
111
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAoCA;AACO,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAsCA;AACO,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export { default as asyncUtils } from './core/asyncUtils/index.js';
8
8
  export { default as colorUtils } from './core/colorUtils/index.js';
9
9
  export { default as cryptoUtils } from './core/cryptoUtils/index.js';
10
10
  export { ITablePage, defTableData, default as pageUtils } from './core/pageUtils/index.js';
11
+ export { default as diffUtils } from './core/diffUtils/index.js';
12
+ export { default as fileUtils } from './core/fileUtils/index.js';
11
13
  export { default as storageUtils } from './core/storageUtils/index.js';
12
14
  import * as index from './core/constants/index.js';
13
15
  export { index as constants };
@@ -25,7 +27,10 @@ export { FormItemLabelProps, FormItemProps, IUploadProps, RequiredMark, TooltipP
25
27
  export { BaseRule, RuleType } from './form/rule.js';
26
28
  export { IBaseFilter, IOptions, IOptions2, IOptions61, ITreeNode, IValidityNum, IWaterInfo, IWaterLives, defBaseFilter } from './types/data/index.js';
27
29
  export { ISysDisFilter, ISysDistrict } from './types/dbData/index.js';
30
+ export { default as ReqQueue } from './request/ReqQueue/index.js';
31
+ export { default as uniRequest } from './request/uniRequest/index.js';
28
32
  export { ICacheData, ICallBack, IRequestOption } from './request/typings/index.js';
33
+ export { codeMessage, defOption } from './request/httpCode/index.js';
29
34
 
30
35
  declare const version = "1.0.0";
31
36
 
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var base = require('./base.cjs');
4
+
5
+ class ArrayDiff extends base.default {
6
+ tokenize(value) {
7
+ return value.slice();
8
+ }
9
+ join(value) {
10
+ return value;
11
+ }
12
+ removeEmpty(value) {
13
+ return value;
14
+ }
15
+ }
16
+ const arrayDiff = new ArrayDiff();
17
+ function diffArrays(oldArr, newArr, options) {
18
+ return arrayDiff.diff(oldArr, newArr, options);
19
+ }
20
+
21
+ exports.arrayDiff = arrayDiff;
22
+ exports.diffArrays = diffArrays;
23
+ //# sourceMappingURL=array.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.cjs","sources":["../../../../../../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.js"],"sourcesContent":["import Diff from './base.js';\nclass ArrayDiff extends Diff {\n tokenize(value) {\n return value.slice();\n }\n join(value) {\n return value;\n }\n removeEmpty(value) {\n return value;\n }\n}\nexport const arrayDiff = new ArrayDiff();\nexport function diffArrays(oldArr, newArr, options) {\n return arrayDiff.diff(oldArr, newArr, options);\n}\n"],"names":["Diff"],"mappings":";;;;AACA,MAAM,SAAS,SAASA,YAAI,CAAC;AAC7B,IAAI,QAAQ,CAAC,KAAK,EAAE;AACpB,QAAQ,OAAO,KAAK,CAAC,KAAK,EAAE;AAC5B,IAAI;AACJ,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;AACY,MAAC,SAAS,GAAG,IAAI,SAAS;AAC/B,SAAS,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;AACpD,IAAI,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AAClD;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,260 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ class Diff {
6
+ diff(oldStr, newStr,
7
+ // Type below is not accurate/complete - see above for full possibilities - but it compiles
8
+ options = {}) {
9
+ let callback;
10
+ if (typeof options === 'function') {
11
+ callback = options;
12
+ options = {};
13
+ }
14
+ else if ('callback' in options) {
15
+ callback = options.callback;
16
+ }
17
+ // Allow subclasses to massage the input prior to running
18
+ const oldString = this.castInput(oldStr, options);
19
+ const newString = this.castInput(newStr, options);
20
+ const oldTokens = this.removeEmpty(this.tokenize(oldString, options));
21
+ const newTokens = this.removeEmpty(this.tokenize(newString, options));
22
+ return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);
23
+ }
24
+ diffWithOptionsObj(oldTokens, newTokens, options, callback) {
25
+ var _a;
26
+ const done = (value) => {
27
+ value = this.postProcess(value, options);
28
+ if (callback) {
29
+ setTimeout(function () { callback(value); }, 0);
30
+ return undefined;
31
+ }
32
+ else {
33
+ return value;
34
+ }
35
+ };
36
+ const newLen = newTokens.length, oldLen = oldTokens.length;
37
+ let editLength = 1;
38
+ let maxEditLength = newLen + oldLen;
39
+ if (options.maxEditLength != null) {
40
+ maxEditLength = Math.min(maxEditLength, options.maxEditLength);
41
+ }
42
+ const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity;
43
+ const abortAfterTimestamp = Date.now() + maxExecutionTime;
44
+ const bestPath = [{ oldPos: -1, lastComponent: undefined }];
45
+ // Seed editLength = 0, i.e. the content starts with the same values
46
+ let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);
47
+ if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
48
+ // Identity per the equality and tokenizer
49
+ return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
50
+ }
51
+ // Once we hit the right edge of the edit graph on some diagonal k, we can
52
+ // definitely reach the end of the edit graph in no more than k edits, so
53
+ // there's no point in considering any moves to diagonal k+1 any more (from
54
+ // which we're guaranteed to need at least k+1 more edits).
55
+ // Similarly, once we've reached the bottom of the edit graph, there's no
56
+ // point considering moves to lower diagonals.
57
+ // We record this fact by setting minDiagonalToConsider and
58
+ // maxDiagonalToConsider to some finite value once we've hit the edge of
59
+ // the edit graph.
60
+ // This optimization is not faithful to the original algorithm presented in
61
+ // Myers's paper, which instead pointlessly extends D-paths off the end of
62
+ // the edit graph - see page 7 of Myers's paper which notes this point
63
+ // explicitly and illustrates it with a diagram. This has major performance
64
+ // implications for some common scenarios. For instance, to compute a diff
65
+ // where the new text simply appends d characters on the end of the
66
+ // original text of length n, the true Myers algorithm will take O(n+d^2)
67
+ // time while this optimization needs only O(n+d) time.
68
+ let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
69
+ // Main worker method. checks all permutations of a given edit length for acceptance.
70
+ const execEditLength = () => {
71
+ for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
72
+ let basePath;
73
+ const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
74
+ if (removePath) {
75
+ // No one else is going to attempt to use this value, clear it
76
+ // @ts-expect-error - perf optimisation. This type-violating value will never be read.
77
+ bestPath[diagonalPath - 1] = undefined;
78
+ }
79
+ let canAdd = false;
80
+ if (addPath) {
81
+ // what newPos will be after we do an insertion:
82
+ const addPathNewPos = addPath.oldPos - diagonalPath;
83
+ canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
84
+ }
85
+ const canRemove = removePath && removePath.oldPos + 1 < oldLen;
86
+ if (!canAdd && !canRemove) {
87
+ // If this path is a terminal then prune
88
+ // @ts-expect-error - perf optimisation. This type-violating value will never be read.
89
+ bestPath[diagonalPath] = undefined;
90
+ continue;
91
+ }
92
+ // Select the diagonal that we want to branch from. We select the prior
93
+ // path whose position in the old string is the farthest from the origin
94
+ // and does not pass the bounds of the diff graph
95
+ if (!canRemove || (canAdd && removePath.oldPos < addPath.oldPos)) {
96
+ basePath = this.addToPath(addPath, true, false, 0, options);
97
+ }
98
+ else {
99
+ basePath = this.addToPath(removePath, false, true, 1, options);
100
+ }
101
+ newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);
102
+ if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
103
+ // If we have hit the end of both strings, then we are done
104
+ return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
105
+ }
106
+ else {
107
+ bestPath[diagonalPath] = basePath;
108
+ if (basePath.oldPos + 1 >= oldLen) {
109
+ maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
110
+ }
111
+ if (newPos + 1 >= newLen) {
112
+ minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
113
+ }
114
+ }
115
+ }
116
+ editLength++;
117
+ };
118
+ // Performs the length of edit iteration. Is a bit fugly as this has to support the
119
+ // sync and async mode which is never fun. Loops over execEditLength until a value
120
+ // is produced, or until the edit length exceeds options.maxEditLength (if given),
121
+ // in which case it will return undefined.
122
+ if (callback) {
123
+ (function exec() {
124
+ setTimeout(function () {
125
+ if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
126
+ return callback(undefined);
127
+ }
128
+ if (!execEditLength()) {
129
+ exec();
130
+ }
131
+ }, 0);
132
+ }());
133
+ }
134
+ else {
135
+ while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
136
+ const ret = execEditLength();
137
+ if (ret) {
138
+ return ret;
139
+ }
140
+ }
141
+ }
142
+ }
143
+ addToPath(path, added, removed, oldPosInc, options) {
144
+ const last = path.lastComponent;
145
+ if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
146
+ return {
147
+ oldPos: path.oldPos + oldPosInc,
148
+ lastComponent: { count: last.count + 1, added: added, removed: removed, previousComponent: last.previousComponent }
149
+ };
150
+ }
151
+ else {
152
+ return {
153
+ oldPos: path.oldPos + oldPosInc,
154
+ lastComponent: { count: 1, added: added, removed: removed, previousComponent: last }
155
+ };
156
+ }
157
+ }
158
+ extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {
159
+ const newLen = newTokens.length, oldLen = oldTokens.length;
160
+ let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
161
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {
162
+ newPos++;
163
+ oldPos++;
164
+ commonCount++;
165
+ if (options.oneChangePerToken) {
166
+ basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };
167
+ }
168
+ }
169
+ if (commonCount && !options.oneChangePerToken) {
170
+ basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };
171
+ }
172
+ basePath.oldPos = oldPos;
173
+ return newPos;
174
+ }
175
+ equals(left, right, options) {
176
+ if (options.comparator) {
177
+ return options.comparator(left, right);
178
+ }
179
+ else {
180
+ return left === right
181
+ || (!!options.ignoreCase && left.toLowerCase() === right.toLowerCase());
182
+ }
183
+ }
184
+ removeEmpty(array) {
185
+ const ret = [];
186
+ for (let i = 0; i < array.length; i++) {
187
+ if (array[i]) {
188
+ ret.push(array[i]);
189
+ }
190
+ }
191
+ return ret;
192
+ }
193
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
194
+ castInput(value, options) {
195
+ return value;
196
+ }
197
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
198
+ tokenize(value, options) {
199
+ return Array.from(value);
200
+ }
201
+ join(chars) {
202
+ // Assumes ValueT is string, which is the case for most subclasses.
203
+ // When it's false, e.g. in diffArrays, this method needs to be overridden (e.g. with a no-op)
204
+ // Yes, the casts are verbose and ugly, because this pattern - of having the base class SORT OF
205
+ // assume tokens and values are strings, but not completely - is weird and janky.
206
+ return chars.join('');
207
+ }
208
+ postProcess(changeObjects,
209
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
210
+ options) {
211
+ return changeObjects;
212
+ }
213
+ get useLongestToken() {
214
+ return false;
215
+ }
216
+ buildValues(lastComponent, newTokens, oldTokens) {
217
+ // First we convert our linked list of components in reverse order to an
218
+ // array in the right order:
219
+ const components = [];
220
+ let nextComponent;
221
+ while (lastComponent) {
222
+ components.push(lastComponent);
223
+ nextComponent = lastComponent.previousComponent;
224
+ delete lastComponent.previousComponent;
225
+ lastComponent = nextComponent;
226
+ }
227
+ components.reverse();
228
+ const componentLen = components.length;
229
+ let componentPos = 0, newPos = 0, oldPos = 0;
230
+ for (; componentPos < componentLen; componentPos++) {
231
+ const component = components[componentPos];
232
+ if (!component.removed) {
233
+ if (!component.added && this.useLongestToken) {
234
+ let value = newTokens.slice(newPos, newPos + component.count);
235
+ value = value.map(function (value, i) {
236
+ const oldValue = oldTokens[oldPos + i];
237
+ return oldValue.length > value.length ? oldValue : value;
238
+ });
239
+ component.value = this.join(value);
240
+ }
241
+ else {
242
+ component.value = this.join(newTokens.slice(newPos, newPos + component.count));
243
+ }
244
+ newPos += component.count;
245
+ // Common case
246
+ if (!component.added) {
247
+ oldPos += component.count;
248
+ }
249
+ }
250
+ else {
251
+ component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));
252
+ oldPos += component.count;
253
+ }
254
+ }
255
+ return components;
256
+ }
257
+ }
258
+
259
+ exports.default = Diff;
260
+ //# sourceMappingURL=base.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.cjs","sources":["../../../../../../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js"],"sourcesContent":["export default class Diff {\n diff(oldStr, newStr, \n // Type below is not accurate/complete - see above for full possibilities - but it compiles\n options = {}) {\n let callback;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n else if ('callback' in options) {\n callback = options.callback;\n }\n // Allow subclasses to massage the input prior to running\n const oldString = this.castInput(oldStr, options);\n const newString = this.castInput(newStr, options);\n const oldTokens = this.removeEmpty(this.tokenize(oldString, options));\n const newTokens = this.removeEmpty(this.tokenize(newString, options));\n return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);\n }\n diffWithOptionsObj(oldTokens, newTokens, options, callback) {\n var _a;\n const done = (value) => {\n value = this.postProcess(value, options);\n if (callback) {\n setTimeout(function () { callback(value); }, 0);\n return undefined;\n }\n else {\n return value;\n }\n };\n const newLen = newTokens.length, oldLen = oldTokens.length;\n let editLength = 1;\n let maxEditLength = newLen + oldLen;\n if (options.maxEditLength != null) {\n maxEditLength = Math.min(maxEditLength, options.maxEditLength);\n }\n const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity;\n const abortAfterTimestamp = Date.now() + maxExecutionTime;\n const bestPath = [{ oldPos: -1, lastComponent: undefined }];\n // Seed editLength = 0, i.e. the content starts with the same values\n let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);\n if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // Identity per the equality and tokenizer\n return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));\n }\n // Once we hit the right edge of the edit graph on some diagonal k, we can\n // definitely reach the end of the edit graph in no more than k edits, so\n // there's no point in considering any moves to diagonal k+1 any more (from\n // which we're guaranteed to need at least k+1 more edits).\n // Similarly, once we've reached the bottom of the edit graph, there's no\n // point considering moves to lower diagonals.\n // We record this fact by setting minDiagonalToConsider and\n // maxDiagonalToConsider to some finite value once we've hit the edge of\n // the edit graph.\n // This optimization is not faithful to the original algorithm presented in\n // Myers's paper, which instead pointlessly extends D-paths off the end of\n // the edit graph - see page 7 of Myers's paper which notes this point\n // explicitly and illustrates it with a diagram. This has major performance\n // implications for some common scenarios. For instance, to compute a diff\n // where the new text simply appends d characters on the end of the\n // original text of length n, the true Myers algorithm will take O(n+d^2)\n // time while this optimization needs only O(n+d) time.\n let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;\n // Main worker method. checks all permutations of a given edit length for acceptance.\n const execEditLength = () => {\n for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {\n let basePath;\n const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];\n if (removePath) {\n // No one else is going to attempt to use this value, clear it\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath - 1] = undefined;\n }\n let canAdd = false;\n if (addPath) {\n // what newPos will be after we do an insertion:\n const addPathNewPos = addPath.oldPos - diagonalPath;\n canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;\n }\n const canRemove = removePath && removePath.oldPos + 1 < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath] = undefined;\n continue;\n }\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the old string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canRemove || (canAdd && removePath.oldPos < addPath.oldPos)) {\n basePath = this.addToPath(addPath, true, false, 0, options);\n }\n else {\n basePath = this.addToPath(removePath, false, true, 1, options);\n }\n newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);\n if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // If we have hit the end of both strings, then we are done\n return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;\n }\n else {\n bestPath[diagonalPath] = basePath;\n if (basePath.oldPos + 1 >= oldLen) {\n maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);\n }\n if (newPos + 1 >= newLen) {\n minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);\n }\n }\n }\n editLength++;\n };\n // Performs the length of edit iteration. Is a bit fugly as this has to support the\n // sync and async mode which is never fun. Loops over execEditLength until a value\n // is produced, or until the edit length exceeds options.maxEditLength (if given),\n // in which case it will return undefined.\n if (callback) {\n (function exec() {\n setTimeout(function () {\n if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {\n return callback(undefined);\n }\n if (!execEditLength()) {\n exec();\n }\n }, 0);\n }());\n }\n else {\n while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {\n const ret = execEditLength();\n if (ret) {\n return ret;\n }\n }\n }\n }\n addToPath(path, added, removed, oldPosInc, options) {\n const last = path.lastComponent;\n if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: last.count + 1, added: added, removed: removed, previousComponent: last.previousComponent }\n };\n }\n else {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: 1, added: added, removed: removed, previousComponent: last }\n };\n }\n }\n extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {\n const newLen = newTokens.length, oldLen = oldTokens.length;\n let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {\n newPos++;\n oldPos++;\n commonCount++;\n if (options.oneChangePerToken) {\n basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n }\n if (commonCount && !options.oneChangePerToken) {\n basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n basePath.oldPos = oldPos;\n return newPos;\n }\n equals(left, right, options) {\n if (options.comparator) {\n return options.comparator(left, right);\n }\n else {\n return left === right\n || (!!options.ignoreCase && left.toLowerCase() === right.toLowerCase());\n }\n }\n removeEmpty(array) {\n const ret = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n return ret;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n castInput(value, options) {\n return value;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tokenize(value, options) {\n return Array.from(value);\n }\n join(chars) {\n // Assumes ValueT is string, which is the case for most subclasses.\n // When it's false, e.g. in diffArrays, this method needs to be overridden (e.g. with a no-op)\n // Yes, the casts are verbose and ugly, because this pattern - of having the base class SORT OF\n // assume tokens and values are strings, but not completely - is weird and janky.\n return chars.join('');\n }\n postProcess(changeObjects, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options) {\n return changeObjects;\n }\n get useLongestToken() {\n return false;\n }\n buildValues(lastComponent, newTokens, oldTokens) {\n // First we convert our linked list of components in reverse order to an\n // array in the right order:\n const components = [];\n let nextComponent;\n while (lastComponent) {\n components.push(lastComponent);\n nextComponent = lastComponent.previousComponent;\n delete lastComponent.previousComponent;\n lastComponent = nextComponent;\n }\n components.reverse();\n const componentLen = components.length;\n let componentPos = 0, newPos = 0, oldPos = 0;\n for (; componentPos < componentLen; componentPos++) {\n const component = components[componentPos];\n if (!component.removed) {\n if (!component.added && this.useLongestToken) {\n let value = newTokens.slice(newPos, newPos + component.count);\n value = value.map(function (value, i) {\n const oldValue = oldTokens[oldPos + i];\n return oldValue.length > value.length ? oldValue : value;\n });\n component.value = this.join(value);\n }\n else {\n component.value = this.join(newTokens.slice(newPos, newPos + component.count));\n }\n newPos += component.count;\n // Common case\n if (!component.added) {\n oldPos += component.count;\n }\n }\n else {\n component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));\n oldPos += component.count;\n }\n }\n return components;\n }\n}\n"],"names":[],"mappings":";;;;AAAe,MAAM,IAAI,CAAC;AAC1B,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM;AACvB;AACA,IAAI,OAAO,GAAG,EAAE,EAAE;AAClB,QAAQ,IAAI,QAAQ;AACpB,QAAQ,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAC3C,YAAY,QAAQ,GAAG,OAAO;AAC9B,YAAY,OAAO,GAAG,EAAE;AACxB,QAAQ;AACR,aAAa,IAAI,UAAU,IAAI,OAAO,EAAE;AACxC,YAAY,QAAQ,GAAG,OAAO,CAAC,QAAQ;AACvC,QAAQ;AACR;AACA,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AACzD,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;A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1,14 @@
1
+ 'use strict';
2
+
3
+ var base = require('./base.cjs');
4
+
5
+ class CharacterDiff extends base.default {
6
+ }
7
+ const characterDiff = new CharacterDiff();
8
+ function diffChars(oldStr, newStr, options) {
9
+ return characterDiff.diff(oldStr, newStr, options);
10
+ }
11
+
12
+ exports.characterDiff = characterDiff;
13
+ exports.diffChars = diffChars;
14
+ //# sourceMappingURL=character.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character.cjs","sources":["../../../../../../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js"],"sourcesContent":["import Diff from './base.js';\nclass CharacterDiff extends Diff {\n}\nexport const characterDiff = new CharacterDiff();\nexport function diffChars(oldStr, newStr, options) {\n return characterDiff.diff(oldStr, newStr, options);\n}\n"],"names":["Diff"],"mappings":";;;;AACA,MAAM,aAAa,SAASA,YAAI,CAAC;AACjC;AACY,MAAC,aAAa,GAAG,IAAI,aAAa;AACvC,SAAS,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;AACnD,IAAI,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACtD;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,25 @@
1
+ type IReqQueueInit = {
2
+ maxQueueLength?: number;
3
+ cacheMethod?: (v: Record<string, any>) => void;
4
+ };
5
+ declare class ReqQueue {
6
+ private static instance;
7
+ private static reqQueue;
8
+ private static maxQueueLength;
9
+ private static cacheMethod;
10
+ constructor(p: IReqQueueInit);
11
+ static init(p: IReqQueueInit): ReqQueue;
12
+ static getInstance(p: IReqQueueInit): ReqQueue;
13
+ /**
14
+ * 获取下日志队列
15
+ */
16
+ static getReqQueue(): Record<string, any>;
17
+ /**
18
+ * 添加或者更新一条记录
19
+ * @param data
20
+ * @param key
21
+ */
22
+ static addReqQueue(data: any, key?: string): Promise<void>;
23
+ }
24
+
25
+ export { ReqQueue as default };
@@ -0,0 +1,9 @@
1
+ import { IRequestOption } from '../typings/index.js';
2
+
3
+ /**
4
+ * HTTP编码属性
5
+ */
6
+ declare const codeMessage: any;
7
+ declare const defOption: IRequestOption;
8
+
9
+ export { codeMessage, defOption };