@casual-simulation/expect 2.0.18

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 (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -0
  3. package/index.d.ts +6 -0
  4. package/index.js +5 -0
  5. package/index.js.map +1 -0
  6. package/package.json +35 -0
  7. package/src/asymmetricMatchers.d.ts +67 -0
  8. package/src/asymmetricMatchers.js +188 -0
  9. package/src/asymmetricMatchers.js.map +1 -0
  10. package/src/diff/cleanupSemantic.d.ts +58 -0
  11. package/src/diff/cleanupSemantic.js +526 -0
  12. package/src/diff/cleanupSemantic.js.map +1 -0
  13. package/src/diff/constants.d.ts +9 -0
  14. package/src/diff/constants.js +10 -0
  15. package/src/diff/constants.js.map +1 -0
  16. package/src/diff/diffLines.d.ts +13 -0
  17. package/src/diff/diffLines.js +138 -0
  18. package/src/diff/diffLines.js.map +1 -0
  19. package/src/diff/diffStrings.d.ts +10 -0
  20. package/src/diff/diffStrings.js +36 -0
  21. package/src/diff/diffStrings.js.map +1 -0
  22. package/src/diff/getAlignedDiffs.d.ts +11 -0
  23. package/src/diff/getAlignedDiffs.js +187 -0
  24. package/src/diff/getAlignedDiffs.js.map +1 -0
  25. package/src/diff/index.d.ts +16 -0
  26. package/src/diff/index.js +139 -0
  27. package/src/diff/index.js.map +1 -0
  28. package/src/diff/joinAlignedDiffs.d.ts +11 -0
  29. package/src/diff/joinAlignedDiffs.js +191 -0
  30. package/src/diff/joinAlignedDiffs.js.map +1 -0
  31. package/src/diff/normalizeDiffOptions.d.ts +10 -0
  32. package/src/diff/normalizeDiffOptions.js +40 -0
  33. package/src/diff/normalizeDiffOptions.js.map +1 -0
  34. package/src/diff/printDiffs.d.ts +11 -0
  35. package/src/diff/printDiffs.js +46 -0
  36. package/src/diff/printDiffs.js.map +1 -0
  37. package/src/diff/types.d.ts +49 -0
  38. package/src/diff/types.js +2 -0
  39. package/src/diff/types.js.map +1 -0
  40. package/src/diff-sequences/index.d.ts +19 -0
  41. package/src/diff-sequences/index.js +506 -0
  42. package/src/diff-sequences/index.js.map +1 -0
  43. package/src/extractExpectedAssertionsErrors.d.ts +11 -0
  44. package/src/extractExpectedAssertionsErrors.js +58 -0
  45. package/src/extractExpectedAssertionsErrors.js.map +1 -0
  46. package/src/get-type/index.d.ts +11 -0
  47. package/src/get-type/index.js +57 -0
  48. package/src/get-type/index.js.map +1 -0
  49. package/src/index.d.ts +16 -0
  50. package/src/index.js +247 -0
  51. package/src/index.js.map +1 -0
  52. package/src/jasmineUtils.d.ts +9 -0
  53. package/src/jasmineUtils.js +218 -0
  54. package/src/jasmineUtils.js.map +1 -0
  55. package/src/jestMatchersObject.d.ts +14 -0
  56. package/src/jestMatchersObject.js +78 -0
  57. package/src/jestMatchersObject.js.map +1 -0
  58. package/src/matcher-utils/Replaceable.d.ts +18 -0
  59. package/src/matcher-utils/Replaceable.js +57 -0
  60. package/src/matcher-utils/Replaceable.js.map +1 -0
  61. package/src/matcher-utils/deepCyclicCopyReplaceable.d.ts +8 -0
  62. package/src/matcher-utils/deepCyclicCopyReplaceable.js +96 -0
  63. package/src/matcher-utils/deepCyclicCopyReplaceable.js.map +1 -0
  64. package/src/matcher-utils/index.d.ts +53 -0
  65. package/src/matcher-utils/index.js +341 -0
  66. package/src/matcher-utils/index.js.map +1 -0
  67. package/src/matchers.d.ts +11 -0
  68. package/src/matchers.js +575 -0
  69. package/src/matchers.js.map +1 -0
  70. package/src/message-util/index.d.ts +11 -0
  71. package/src/message-util/index.js +34 -0
  72. package/src/message-util/index.js.map +1 -0
  73. package/src/pretty-format/collections.d.ts +33 -0
  74. package/src/pretty-format/collections.js +130 -0
  75. package/src/pretty-format/collections.js.map +1 -0
  76. package/src/pretty-format/index.d.ts +25 -0
  77. package/src/pretty-format/index.js +390 -0
  78. package/src/pretty-format/index.js.map +1 -0
  79. package/src/pretty-format/plugins/AsymmetricMatcher.d.ts +12 -0
  80. package/src/pretty-format/plugins/AsymmetricMatcher.js +53 -0
  81. package/src/pretty-format/plugins/AsymmetricMatcher.js.map +1 -0
  82. package/src/pretty-format/plugins/ConvertAnsi.d.ts +12 -0
  83. package/src/pretty-format/plugins/ConvertAnsi.js +58 -0
  84. package/src/pretty-format/plugins/ConvertAnsi.js.map +1 -0
  85. package/src/pretty-format/plugins/DOMCollection.d.ts +12 -0
  86. package/src/pretty-format/plugins/DOMCollection.js +39 -0
  87. package/src/pretty-format/plugins/DOMCollection.js.map +1 -0
  88. package/src/pretty-format/plugins/DOMElement.d.ts +12 -0
  89. package/src/pretty-format/plugins/DOMElement.js +68 -0
  90. package/src/pretty-format/plugins/DOMElement.js.map +1 -0
  91. package/src/pretty-format/plugins/Immutable.d.ts +12 -0
  92. package/src/pretty-format/plugins/Immutable.js +113 -0
  93. package/src/pretty-format/plugins/Immutable.js.map +1 -0
  94. package/src/pretty-format/plugins/ReactTestComponent.d.ts +19 -0
  95. package/src/pretty-format/plugins/ReactTestComponent.js +29 -0
  96. package/src/pretty-format/plugins/ReactTestComponent.js.map +1 -0
  97. package/src/pretty-format/plugins/lib/escapeHTML.d.ts +8 -0
  98. package/src/pretty-format/plugins/lib/escapeHTML.js +10 -0
  99. package/src/pretty-format/plugins/lib/escapeHTML.js.map +1 -0
  100. package/src/pretty-format/plugins/lib/markup.d.ts +14 -0
  101. package/src/pretty-format/plugins/lib/markup.js +98 -0
  102. package/src/pretty-format/plugins/lib/markup.js.map +1 -0
  103. package/src/pretty-format/types.d.ts +109 -0
  104. package/src/pretty-format/types.js +8 -0
  105. package/src/pretty-format/types.js.map +1 -0
  106. package/src/print.d.ts +16 -0
  107. package/src/print.js +71 -0
  108. package/src/print.js.map +1 -0
  109. package/src/spyMatchers.d.ts +10 -0
  110. package/src/spyMatchers.js +766 -0
  111. package/src/spyMatchers.js.map +1 -0
  112. package/src/test-utils/ConditionalTest.d.ts +10 -0
  113. package/src/test-utils/ConditionalTest.js +25 -0
  114. package/src/test-utils/ConditionalTest.js.map +1 -0
  115. package/src/test-utils/alignedAnsiStyleSerializer.d.ts +9 -0
  116. package/src/test-utils/alignedAnsiStyleSerializer.js +46 -0
  117. package/src/test-utils/alignedAnsiStyleSerializer.js.map +1 -0
  118. package/src/test-utils/config.d.ts +10 -0
  119. package/src/test-utils/config.js +143 -0
  120. package/src/test-utils/config.js.map +1 -0
  121. package/src/test-utils/index.d.ts +10 -0
  122. package/src/test-utils/index.js +10 -0
  123. package/src/test-utils/index.js.map +1 -0
  124. package/src/toThrowMatchers.d.ts +12 -0
  125. package/src/toThrowMatchers.js +258 -0
  126. package/src/toThrowMatchers.js.map +1 -0
  127. package/src/types.d.ts +327 -0
  128. package/src/types.js +9 -0
  129. package/src/types.js.map +1 -0
  130. package/src/utils.d.ts +26 -0
  131. package/src/utils.js +303 -0
  132. package/src/utils.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Facebook, Inc. and its affiliates.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # @casual-simulation/expect
2
+
3
+ The [expect](https://github.com/facebook/jest/tree/main/packages/expect) library from Jest but compatible with web browsers.
4
+ You can find its documentation [on Jest's website](https://jestjs.io/docs/expect).
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import expect from './src/index';
2
+ import { iterableEquality } from './src/utils';
3
+ import type { Tester } from './src/types';
4
+ export default expect;
5
+ export { iterableEquality, Tester };
6
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import expect from './src/index';
2
+ import { iterableEquality } from './src/utils';
3
+ export default expect;
4
+ export { iterableEquality };
5
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAU,CAAC"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@casual-simulation/expect",
3
+ "version": "2.0.18",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/casual-simulation/casualos.git",
7
+ "directory": "src/expect"
8
+ },
9
+ "license": "MIT",
10
+ "type": "module",
11
+ "module": "index",
12
+ "types": "index.d.ts",
13
+ "dependencies": {
14
+ "@casual-simulation/chalk": "^2.0.18",
15
+ "@jest/types": "^27.2.5"
16
+ },
17
+ "devDependencies": {
18
+ "fast-check": "2.19.0",
19
+ "immutable": "4.0.0"
20
+ },
21
+ "files": [
22
+ "/README.md",
23
+ "/LICENSE",
24
+ "**/*.js",
25
+ "**/*.js.map",
26
+ "**/*.d.ts"
27
+ ],
28
+ "engines": {
29
+ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "gitHead": "f575351b2628581d063a61689eac06c18b8c3bb7"
35
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { AsymmetricMatcher as AsymmetricMatcherInterface, MatcherState } from './types';
9
+ export declare abstract class AsymmetricMatcher<T, State extends MatcherState = MatcherState> implements AsymmetricMatcherInterface {
10
+ protected sample: T;
11
+ protected inverse: boolean;
12
+ $$typeof: symbol;
13
+ constructor(sample: T, inverse?: boolean);
14
+ protected getMatcherContext(): State;
15
+ abstract asymmetricMatch(other: unknown): boolean;
16
+ abstract toString(): string;
17
+ getExpectedType?(): string;
18
+ toAsymmetricMatcher?(): string;
19
+ }
20
+ declare class Any extends AsymmetricMatcher<any> {
21
+ constructor(sample: unknown);
22
+ asymmetricMatch(other: unknown): boolean;
23
+ toString(): string;
24
+ getExpectedType(): any;
25
+ toAsymmetricMatcher(): string;
26
+ }
27
+ declare class Anything extends AsymmetricMatcher<void> {
28
+ asymmetricMatch(other: unknown): boolean;
29
+ toString(): string;
30
+ toAsymmetricMatcher(): string;
31
+ }
32
+ declare class ArrayContaining extends AsymmetricMatcher<Array<unknown>> {
33
+ constructor(sample: Array<unknown>, inverse?: boolean);
34
+ asymmetricMatch(other: Array<unknown>): boolean;
35
+ toString(): string;
36
+ getExpectedType(): string;
37
+ }
38
+ declare class ObjectContaining extends AsymmetricMatcher<Record<string, unknown>> {
39
+ constructor(sample: Record<string, unknown>, inverse?: boolean);
40
+ asymmetricMatch(other?: any): boolean;
41
+ toString(): string;
42
+ getExpectedType(): string;
43
+ }
44
+ declare class StringContaining extends AsymmetricMatcher<string> {
45
+ constructor(sample: string, inverse?: boolean);
46
+ asymmetricMatch(other: string): boolean;
47
+ toString(): string;
48
+ getExpectedType(): string;
49
+ }
50
+ declare class StringMatching extends AsymmetricMatcher<RegExp> {
51
+ constructor(sample: string | RegExp, inverse?: boolean);
52
+ asymmetricMatch(other: string): boolean;
53
+ toString(): string;
54
+ getExpectedType(): string;
55
+ }
56
+ export declare const any: (expectedObject: unknown) => Any;
57
+ export declare const anything: () => Anything;
58
+ export declare const arrayContaining: (sample: Array<unknown>) => ArrayContaining;
59
+ export declare const arrayNotContaining: (sample: Array<unknown>) => ArrayContaining;
60
+ export declare const objectContaining: (sample: Record<string, unknown>) => ObjectContaining;
61
+ export declare const objectNotContaining: (sample: Record<string, unknown>) => ObjectContaining;
62
+ export declare const stringContaining: (expected: string) => StringContaining;
63
+ export declare const stringNotContaining: (expected: string) => StringContaining;
64
+ export declare const stringMatching: (expected: string | RegExp) => StringMatching;
65
+ export declare const stringNotMatching: (expected: string | RegExp) => StringMatching;
66
+ export {};
67
+ //# sourceMappingURL=asymmetricMatchers.d.ts.map
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import * as matcherUtils from './matcher-utils';
9
+ import { equals, fnNameFor, hasProperty, isA, isUndefined, } from './jasmineUtils';
10
+ import { getState } from './jestMatchersObject';
11
+ import { iterableEquality, subsetEquality } from './utils';
12
+ const utils = Object.freeze(Object.assign(Object.assign({}, matcherUtils), { iterableEquality,
13
+ subsetEquality }));
14
+ export class AsymmetricMatcher {
15
+ constructor(sample, inverse = false) {
16
+ this.sample = sample;
17
+ this.inverse = inverse;
18
+ this.$$typeof = Symbol.for('jest.asymmetricMatcher');
19
+ }
20
+ getMatcherContext() {
21
+ return Object.assign(Object.assign({}, getState()), { equals, isNot: this.inverse, utils });
22
+ }
23
+ }
24
+ class Any extends AsymmetricMatcher {
25
+ constructor(sample) {
26
+ if (typeof sample === 'undefined') {
27
+ throw new TypeError('any() expects to be passed a constructor function. ' +
28
+ 'Please pass one or use anything() to match any object.');
29
+ }
30
+ super(sample);
31
+ }
32
+ asymmetricMatch(other) {
33
+ if (this.sample == String) {
34
+ return typeof other == 'string' || other instanceof String;
35
+ }
36
+ if (this.sample == Number) {
37
+ return typeof other == 'number' || other instanceof Number;
38
+ }
39
+ if (this.sample == Function) {
40
+ return typeof other == 'function' || other instanceof Function;
41
+ }
42
+ if (this.sample == Boolean) {
43
+ return typeof other == 'boolean' || other instanceof Boolean;
44
+ }
45
+ if (this.sample == BigInt) {
46
+ return typeof other == 'bigint' || other instanceof BigInt;
47
+ }
48
+ if (this.sample == Symbol) {
49
+ return typeof other == 'symbol' || other instanceof Symbol;
50
+ }
51
+ if (this.sample == Object) {
52
+ return typeof other == 'object';
53
+ }
54
+ return other instanceof this.sample;
55
+ }
56
+ toString() {
57
+ return 'Any';
58
+ }
59
+ getExpectedType() {
60
+ if (this.sample == String) {
61
+ return 'string';
62
+ }
63
+ if (this.sample == Number) {
64
+ return 'number';
65
+ }
66
+ if (this.sample == Function) {
67
+ return 'function';
68
+ }
69
+ if (this.sample == Object) {
70
+ return 'object';
71
+ }
72
+ if (this.sample == Boolean) {
73
+ return 'boolean';
74
+ }
75
+ return fnNameFor(this.sample);
76
+ }
77
+ toAsymmetricMatcher() {
78
+ return 'Any<' + fnNameFor(this.sample) + '>';
79
+ }
80
+ }
81
+ class Anything extends AsymmetricMatcher {
82
+ asymmetricMatch(other) {
83
+ return !isUndefined(other) && other !== null;
84
+ }
85
+ toString() {
86
+ return 'Anything';
87
+ }
88
+ // No getExpectedType method, because it matches either null or undefined.
89
+ toAsymmetricMatcher() {
90
+ return 'Anything';
91
+ }
92
+ }
93
+ class ArrayContaining extends AsymmetricMatcher {
94
+ constructor(sample, inverse = false) {
95
+ super(sample, inverse);
96
+ }
97
+ asymmetricMatch(other) {
98
+ if (!Array.isArray(this.sample)) {
99
+ throw new Error(`You must provide an array to ${this.toString()}, not '` +
100
+ typeof this.sample +
101
+ "'.");
102
+ }
103
+ const result = this.sample.length === 0 ||
104
+ (Array.isArray(other) &&
105
+ this.sample.every((item) => other.some((another) => equals(item, another))));
106
+ return this.inverse ? !result : result;
107
+ }
108
+ toString() {
109
+ return `Array${this.inverse ? 'Not' : ''}Containing`;
110
+ }
111
+ getExpectedType() {
112
+ return 'array';
113
+ }
114
+ }
115
+ class ObjectContaining extends AsymmetricMatcher {
116
+ constructor(sample, inverse = false) {
117
+ super(sample, inverse);
118
+ }
119
+ asymmetricMatch(other) {
120
+ if (typeof this.sample !== 'object') {
121
+ throw new Error(`You must provide an object to ${this.toString()}, not '` +
122
+ typeof this.sample +
123
+ "'.");
124
+ }
125
+ let result = true;
126
+ for (const property in this.sample) {
127
+ if (!hasProperty(other, property) ||
128
+ !equals(this.sample[property], other[property])) {
129
+ result = false;
130
+ break;
131
+ }
132
+ }
133
+ return this.inverse ? !result : result;
134
+ }
135
+ toString() {
136
+ return `Object${this.inverse ? 'Not' : ''}Containing`;
137
+ }
138
+ getExpectedType() {
139
+ return 'object';
140
+ }
141
+ }
142
+ class StringContaining extends AsymmetricMatcher {
143
+ constructor(sample, inverse = false) {
144
+ if (!isA('String', sample)) {
145
+ throw new Error('Expected is not a string');
146
+ }
147
+ super(sample, inverse);
148
+ }
149
+ asymmetricMatch(other) {
150
+ const result = isA('String', other) && other.includes(this.sample);
151
+ return this.inverse ? !result : result;
152
+ }
153
+ toString() {
154
+ return `String${this.inverse ? 'Not' : ''}Containing`;
155
+ }
156
+ getExpectedType() {
157
+ return 'string';
158
+ }
159
+ }
160
+ class StringMatching extends AsymmetricMatcher {
161
+ constructor(sample, inverse = false) {
162
+ if (!isA('String', sample) && !isA('RegExp', sample)) {
163
+ throw new Error('Expected is not a String or a RegExp');
164
+ }
165
+ super(new RegExp(sample), inverse);
166
+ }
167
+ asymmetricMatch(other) {
168
+ const result = isA('String', other) && this.sample.test(other);
169
+ return this.inverse ? !result : result;
170
+ }
171
+ toString() {
172
+ return `String${this.inverse ? 'Not' : ''}Matching`;
173
+ }
174
+ getExpectedType() {
175
+ return 'string';
176
+ }
177
+ }
178
+ export const any = (expectedObject) => new Any(expectedObject);
179
+ export const anything = () => new Anything();
180
+ export const arrayContaining = (sample) => new ArrayContaining(sample);
181
+ export const arrayNotContaining = (sample) => new ArrayContaining(sample, true);
182
+ export const objectContaining = (sample) => new ObjectContaining(sample);
183
+ export const objectNotContaining = (sample) => new ObjectContaining(sample, true);
184
+ export const stringContaining = (expected) => new StringContaining(expected);
185
+ export const stringNotContaining = (expected) => new StringContaining(expected, true);
186
+ export const stringMatching = (expected) => new StringMatching(expected);
187
+ export const stringNotMatching = (expected) => new StringMatching(expected, true);
188
+ //# sourceMappingURL=asymmetricMatchers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asymmetricMatchers.js","sourceRoot":"","sources":["asymmetricMatchers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACH,MAAM,EACN,SAAS,EACT,WAAW,EACX,GAAG,EACH,WAAW,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,iCACpB,YAAY,KACf,gBAAgB;IAChB,cAAc,IAChB,CAAC;AAEH,MAAM,OAAgB,iBAAiB;IAOnC,YAAsB,MAAS,EAAY,UAAU,KAAK;QAApC,WAAM,GAAN,MAAM,CAAG;QAAY,YAAO,GAAP,OAAO,CAAQ;QAF1D,aAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEa,CAAC;IAEpD,iBAAiB;QACvB,OAAO,gCACA,QAAQ,EAAE,KACb,MAAM,EACN,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,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AAQ,EAAE,IAAI,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAyB,EAAkB,EAAE,CACxE,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAyB,EAAkB,EAAE,CAC3E,IAAI,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Diff Match and Patch
3
+ * Copyright 2018 The diff-match-patch Authors.
4
+ * https://github.com/google/diff-match-patch
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ /**
19
+ * @fileoverview Computes the difference between two texts to create a patch.
20
+ * Applies the patch onto another text, allowing for errors.
21
+ * @author fraser@google.com (Neil Fraser)
22
+ */
23
+ /**
24
+ * CHANGES by pedrottimark to diff_match_patch_uncompressed.ts file:
25
+ *
26
+ * 1. Delete anything not needed to use diff_cleanupSemantic method
27
+ * 2. Convert from prototype properties to var declarations
28
+ * 3. Convert Diff to class from constructor and prototype
29
+ * 4. Add type annotations for arguments and return values
30
+ * 5. Add exports
31
+ */
32
+ /**
33
+ * The data structure representing a diff is an array of tuples:
34
+ * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
35
+ * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
36
+ */
37
+ declare var DIFF_DELETE: number;
38
+ declare var DIFF_INSERT: number;
39
+ declare var DIFF_EQUAL: number;
40
+ /**
41
+ * Class representing one diff tuple.
42
+ * Attempts to look like a two-element array (which is what this used to be).
43
+ * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL.
44
+ * @param {string} text Text to be deleted, inserted, or retained.
45
+ * @constructor
46
+ */
47
+ declare class Diff {
48
+ 0: number;
49
+ 1: string;
50
+ constructor(op: number, text: string);
51
+ }
52
+ /**
53
+ * Reduce the number of edits by eliminating semantically trivial equalities.
54
+ * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
55
+ */
56
+ declare var diff_cleanupSemantic: (diffs: Array<Diff>) => void;
57
+ export { Diff, DIFF_EQUAL, DIFF_DELETE, DIFF_INSERT, diff_cleanupSemantic as cleanupSemantic, };
58
+ //# sourceMappingURL=cleanupSemantic.d.ts.map