@rimbu/deep 0.11.2 → 0.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.
- package/dist/main/deep.js +211 -0
- package/dist/main/deep.js.map +1 -0
- package/dist/main/index.js +7 -9
- package/dist/main/index.js.map +1 -1
- package/dist/main/internal.js +6 -4
- package/dist/main/internal.js.map +1 -1
- package/dist/main/match.js +160 -199
- package/dist/main/match.js.map +1 -1
- package/dist/main/patch.js +101 -125
- package/dist/main/patch.js.map +1 -1
- package/dist/main/path.js +109 -62
- package/dist/main/path.js.map +1 -1
- package/dist/main/protected.js +0 -19
- package/dist/main/protected.js.map +1 -1
- package/dist/main/selector.js +40 -0
- package/dist/main/selector.js.map +1 -0
- package/dist/main/tuple.js.map +1 -1
- package/dist/module/deep.js +192 -0
- package/dist/module/deep.js.map +1 -0
- package/dist/module/index.js +9 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/internal.js +4 -4
- package/dist/module/internal.js.map +1 -1
- package/dist/module/match.js +159 -179
- package/dist/module/match.js.map +1 -1
- package/dist/module/patch.js +91 -112
- package/dist/module/patch.js.map +1 -1
- package/dist/module/path.js +99 -44
- package/dist/module/path.js.map +1 -1
- package/dist/module/protected.js +1 -17
- package/dist/module/protected.js.map +1 -1
- package/dist/module/selector.js +36 -0
- package/dist/module/selector.js.map +1 -0
- package/dist/module/tuple.js.map +1 -1
- package/dist/types/deep.d.ts +284 -0
- package/dist/types/index.d.ts +10 -1
- package/dist/types/internal.d.ts +7 -4
- package/dist/types/match.d.ts +74 -80
- package/dist/types/patch.d.ts +57 -50
- package/dist/types/path.d.ts +177 -34
- package/dist/types/protected.d.ts +1 -16
- package/dist/types/selector.d.ts +47 -0
- package/dist/types/tuple.d.ts +10 -0
- package/package.json +4 -4
- package/src/deep.ts +362 -0
- package/src/index.ts +14 -10
- package/src/internal.ts +7 -4
- package/src/match.ts +396 -212
- package/src/patch.ts +173 -176
- package/src/path.ts +400 -74
- package/src/protected.ts +14 -25
- package/src/selector.ts +90 -0
- package/src/tuple.ts +12 -0
package/dist/main/match.js
CHANGED
|
@@ -1,246 +1,207 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.match =
|
|
3
|
+
exports.match = void 0;
|
|
4
4
|
var base_1 = require("@rimbu/base");
|
|
5
|
-
var Match;
|
|
6
|
-
(function (Match) {
|
|
7
|
-
/**
|
|
8
|
-
* Returns a matcher that returns true if every given `matchItem` matches the given value.
|
|
9
|
-
* @typeparam T - the type of value to match
|
|
10
|
-
* @typeparam R - the root object type
|
|
11
|
-
* @typeparam Q - a utility type for the matcher
|
|
12
|
-
* @param matchItems - the match specifications to test
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const input = { a: 1, b: { c: true, d: 'a' } }
|
|
16
|
-
* match(input, Match.every({ a: 1, { c: true } } )) // => true
|
|
17
|
-
* match(input, Match.every({ a: 1, { c: false } } )) // => false
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
function every() {
|
|
21
|
-
var matchItems = [];
|
|
22
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
23
|
-
matchItems[_i] = arguments[_i];
|
|
24
|
-
}
|
|
25
|
-
return new Every(matchItems);
|
|
26
|
-
}
|
|
27
|
-
Match.every = every;
|
|
28
|
-
/**
|
|
29
|
-
* Returns a matcher that returns true if at least one of given `matchItem` matches the given value.
|
|
30
|
-
* @typeparam T - the type of value to match
|
|
31
|
-
* @typeparam R - the root object type
|
|
32
|
-
* @typeparam Q - a utility type for the matcher
|
|
33
|
-
* @param matchItems - the match specifications to test
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const input = { a: 1, b: { c: true, d: 'a' } }
|
|
37
|
-
* match(input, Match.some({ a: 5, { c: true } } )) // => true
|
|
38
|
-
* match(input, Match.some({ a: 5, { c: false } } )) // => false
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
function some() {
|
|
42
|
-
var matchItems = [];
|
|
43
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44
|
-
matchItems[_i] = arguments[_i];
|
|
45
|
-
}
|
|
46
|
-
return new Some(matchItems);
|
|
47
|
-
}
|
|
48
|
-
Match.some = some;
|
|
49
|
-
/**
|
|
50
|
-
* Returns a matcher that returns true if none of given `matchItem` matches the given value.
|
|
51
|
-
* @typeparam T - the type of value to match
|
|
52
|
-
* @typeparam R - the root object type
|
|
53
|
-
* @typeparam Q - a utility type for the matcher
|
|
54
|
-
* @param matchItems - the match specifications to test
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* const input = { a: 1, b: { c: true, d: 'a' } }
|
|
58
|
-
* match(input, Match.none({ a: 5, { c: true } } )) // => false
|
|
59
|
-
* match(input, Match.none({ a: 5, { c: false } } )) // => true
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
function none() {
|
|
63
|
-
var matchItems = [];
|
|
64
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
65
|
-
matchItems[_i] = arguments[_i];
|
|
66
|
-
}
|
|
67
|
-
return new None(matchItems);
|
|
68
|
-
}
|
|
69
|
-
Match.none = none;
|
|
70
|
-
/**
|
|
71
|
-
* Returns a matcher that returns true if exactly one of given `matchItem` matches the given value.
|
|
72
|
-
* @typeparam T - the type of value to match
|
|
73
|
-
* @typeparam R - the root object type
|
|
74
|
-
* @typeparam Q - a utility type for the matcher
|
|
75
|
-
* @param matchItems - the match specifications to test
|
|
76
|
-
* @example
|
|
77
|
-
* ```ts
|
|
78
|
-
* const input = { a: 1, b: { c: true, d: 'a' } }
|
|
79
|
-
* match(input, Match.single({ a: 1, { c: true } } )) // => false
|
|
80
|
-
* match(input, Match.single({ a: 1, { c: false } } )) // => true
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
function single() {
|
|
84
|
-
var matchItems = [];
|
|
85
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
86
|
-
matchItems[_i] = arguments[_i];
|
|
87
|
-
}
|
|
88
|
-
return new Single(matchItems);
|
|
89
|
-
}
|
|
90
|
-
Match.single = single;
|
|
91
|
-
})(Match = exports.Match || (exports.Match = {}));
|
|
92
|
-
var Every = /** @class */ (function () {
|
|
93
|
-
function Every(matchItems) {
|
|
94
|
-
this.matchItems = matchItems;
|
|
95
|
-
}
|
|
96
|
-
return Every;
|
|
97
|
-
}());
|
|
98
|
-
var Some = /** @class */ (function () {
|
|
99
|
-
function Some(matchItems) {
|
|
100
|
-
this.matchItems = matchItems;
|
|
101
|
-
}
|
|
102
|
-
return Some;
|
|
103
|
-
}());
|
|
104
|
-
var None = /** @class */ (function () {
|
|
105
|
-
function None(matchItems) {
|
|
106
|
-
this.matchItems = matchItems;
|
|
107
|
-
}
|
|
108
|
-
return None;
|
|
109
|
-
}());
|
|
110
|
-
var Single = /** @class */ (function () {
|
|
111
|
-
function Single(matchItems) {
|
|
112
|
-
this.matchItems = matchItems;
|
|
113
|
-
}
|
|
114
|
-
return Single;
|
|
115
|
-
}());
|
|
116
5
|
/**
|
|
117
6
|
* Returns true if the given `value` object matches the given `matcher`, false otherwise.
|
|
118
7
|
* @typeparam T - the input value type
|
|
119
|
-
* @
|
|
8
|
+
* @typeparam C - utility type
|
|
9
|
+
* @param source - the value to match (should be a plain object)
|
|
120
10
|
* @param matcher - a matcher object or a function taking the matcher API and returning a match object
|
|
11
|
+
* @param errorCollector - (optional) a string array that can be passed to collect reasons why the match failed
|
|
121
12
|
* @example
|
|
122
13
|
* ```ts
|
|
123
14
|
* const input = { a: 1, b: { c: true, d: 'a' } }
|
|
124
15
|
* match(input, { a: 1 }) // => true
|
|
125
16
|
* match(input, { a: 2 }) // => false
|
|
126
|
-
* match(input, { a: v => v > 10 }) // => false
|
|
17
|
+
* match(input, { a: (v) => v > 10 }) // => false
|
|
127
18
|
* match(input, { b: { c: true }}) // => true
|
|
128
|
-
* match(input, (
|
|
19
|
+
* match(input, (['every', { a: (v) => v > 0 }, { b: { c: true } }]) // => true
|
|
129
20
|
* match(input, { b: { c: (v, parent, root) => v && parent.d.length > 0 && root.a > 0 } })
|
|
130
21
|
* // => true
|
|
131
22
|
* ```
|
|
132
23
|
*/
|
|
133
|
-
function match(
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
return matchOptions(value, value, matcher);
|
|
24
|
+
function match(source, matcher, errorCollector) {
|
|
25
|
+
if (errorCollector === void 0) { errorCollector = undefined; }
|
|
26
|
+
return matchEntry(source, source, source, matcher, errorCollector);
|
|
138
27
|
}
|
|
139
28
|
exports.match = match;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (!matchOptions(value, root, matchItems[i])) {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
29
|
+
/**
|
|
30
|
+
* Match a generic match entry against the given source.
|
|
31
|
+
*/
|
|
32
|
+
function matchEntry(source, parent, root, matcher, errorCollector) {
|
|
33
|
+
if (Object.is(source, matcher)) {
|
|
34
|
+
// value and target are exactly the same, always will be true
|
|
150
35
|
return true;
|
|
151
36
|
}
|
|
152
|
-
if (matcher
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
37
|
+
if (matcher === null || matcher === undefined) {
|
|
38
|
+
// these matchers can only be direct matches, and previously it was determined that
|
|
39
|
+
// they are not equal
|
|
40
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("value ".concat(JSON.stringify(source), " did not match matcher ").concat(matcher));
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (typeof source === 'function') {
|
|
44
|
+
// function source values can only be directly matched
|
|
45
|
+
var result = Object.is(source, matcher);
|
|
46
|
+
if (!result) {
|
|
47
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("both value and matcher are functions, but they do not have the same reference");
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
if (typeof matcher === 'function') {
|
|
52
|
+
// resolve match function first
|
|
53
|
+
var matcherResult = matcher(source, parent, root);
|
|
54
|
+
if (typeof matcherResult === 'boolean') {
|
|
55
|
+
// function resulted in a direct match result
|
|
56
|
+
if (!matcherResult) {
|
|
57
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("function matcher returned false for value ".concat(JSON.stringify(source)));
|
|
159
58
|
}
|
|
59
|
+
return matcherResult;
|
|
160
60
|
}
|
|
161
|
-
|
|
61
|
+
// function resulted in a value that needs to be further matched
|
|
62
|
+
return matchEntry(source, parent, root, matcherResult, errorCollector);
|
|
162
63
|
}
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
64
|
+
if ((0, base_1.isPlainObj)(source)) {
|
|
65
|
+
// source ia a plain object, can be partially matched
|
|
66
|
+
return matchPlainObj(source, parent, root, matcher, errorCollector);
|
|
67
|
+
}
|
|
68
|
+
if (Array.isArray(source)) {
|
|
69
|
+
// source is an array
|
|
70
|
+
return matchArr(source, root, matcher, errorCollector);
|
|
71
|
+
}
|
|
72
|
+
// already determined above that the source and matcher are not equal
|
|
73
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("value ".concat(JSON.stringify(source), " does not match given matcher ").concat(JSON.stringify(matcher)));
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Match an array matcher against the given source.
|
|
78
|
+
*/
|
|
79
|
+
function matchArr(source, root, matcher, errorCollector) {
|
|
80
|
+
if (Array.isArray(matcher)) {
|
|
81
|
+
// directly compare array contents
|
|
82
|
+
var length_1 = source.length;
|
|
83
|
+
if (length_1 !== matcher.length) {
|
|
84
|
+
// if lengths not equal, arrays are not equal
|
|
85
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("array lengths are not equal: value length ".concat(source.length, " !== matcher length ").concat(matcher.length));
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
// loop over arrays, matching every value
|
|
89
|
+
var index = -1;
|
|
90
|
+
while (++index < length_1) {
|
|
91
|
+
if (!Object.is(source[index], matcher[index])) {
|
|
92
|
+
// item did not match, return false
|
|
93
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("index ".concat(index, " does not match with value ").concat(JSON.stringify(source[index]), " and matcher ").concat(matcher[index]));
|
|
169
94
|
return false;
|
|
170
95
|
}
|
|
171
96
|
}
|
|
97
|
+
// all items are equal
|
|
172
98
|
return true;
|
|
173
99
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
100
|
+
// matcher is plain object with index keys
|
|
101
|
+
for (var index in matcher) {
|
|
102
|
+
var matcherAtIndex = matcher[index];
|
|
103
|
+
if (!(index in source)) {
|
|
104
|
+
// source does not have item at given index
|
|
105
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("index ".concat(index, " does not exist in source ").concat(JSON.stringify(source), " but should match matcher ").concat(JSON.stringify(matcherAtIndex)));
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
// match the source item at the given index
|
|
109
|
+
var result = matchEntry(source[index], source, root, matcherAtIndex, errorCollector);
|
|
110
|
+
if (!result) {
|
|
111
|
+
// item did not match
|
|
112
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("index ".concat(index, " does not match with value ").concat(JSON.stringify(source[index]), " and matcher ").concat(JSON.stringify(matcherAtIndex)));
|
|
113
|
+
return false;
|
|
186
114
|
}
|
|
187
|
-
return matched;
|
|
188
|
-
}
|
|
189
|
-
if ((0, base_1.isPlainObj)(matcher)) {
|
|
190
|
-
return matchRecord(value, root, matcher);
|
|
191
115
|
}
|
|
192
|
-
|
|
116
|
+
// all items match
|
|
117
|
+
return true;
|
|
193
118
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Match an object matcher against the given source.
|
|
121
|
+
*/
|
|
122
|
+
function matchPlainObj(source, parent, root, matcher, errorCollector) {
|
|
123
|
+
if (Array.isArray(matcher)) {
|
|
124
|
+
// the matcher is of compound type
|
|
125
|
+
return matchCompound(source, parent, root, matcher, errorCollector);
|
|
197
126
|
}
|
|
127
|
+
// partial object props matcher
|
|
198
128
|
for (var key in matcher) {
|
|
199
|
-
if (!(key in
|
|
129
|
+
if (!(key in source)) {
|
|
130
|
+
// the source does not have the given key
|
|
131
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("key ".concat(key, " is specified in matcher but not present in value ").concat(JSON.stringify(source)));
|
|
200
132
|
return false;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
133
|
+
}
|
|
134
|
+
// match the source value at the given key with the matcher at given key
|
|
135
|
+
var result = matchEntry(source[key], source, root, matcher[key], errorCollector);
|
|
136
|
+
if (!result) {
|
|
137
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("key ".concat(key, " does not match in value ").concat(JSON.stringify(source[key]), " with matcher ").concat(JSON.stringify(matcher[key])));
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// all properties match
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Match a compound matcher against the given source.
|
|
146
|
+
*/
|
|
147
|
+
function matchCompound(source, parent, root, compound, errorCollector) {
|
|
148
|
+
// first item indicates compound match type
|
|
149
|
+
var matchType = compound[0];
|
|
150
|
+
var length = compound.length;
|
|
151
|
+
// start at index 1
|
|
152
|
+
var index = 0;
|
|
153
|
+
switch (matchType) {
|
|
154
|
+
case 'every': {
|
|
155
|
+
while (++index < length) {
|
|
156
|
+
// if any item does not match, return false
|
|
157
|
+
var result = matchEntry(source, parent, root, compound[index], errorCollector);
|
|
158
|
+
if (!result) {
|
|
159
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("in compound \"every\": match at index ".concat(index, " failed"));
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
206
162
|
}
|
|
207
|
-
|
|
208
|
-
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
case 'none': {
|
|
166
|
+
// if any item matches, return false
|
|
167
|
+
while (++index < length) {
|
|
168
|
+
var result = matchEntry(source, parent, root, compound[index], errorCollector);
|
|
209
169
|
if (result) {
|
|
210
|
-
|
|
170
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("in compound \"none\": match at index ".concat(index, " succeeded"));
|
|
171
|
+
return false;
|
|
211
172
|
}
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
if (!matchRecordItem(target, root, result)) {
|
|
215
|
-
return false;
|
|
216
173
|
}
|
|
174
|
+
return true;
|
|
217
175
|
}
|
|
218
|
-
|
|
219
|
-
if
|
|
220
|
-
|
|
176
|
+
case 'single': {
|
|
177
|
+
// if not exactly one item matches, return false
|
|
178
|
+
var onePassed = false;
|
|
179
|
+
while (++index < length) {
|
|
180
|
+
var result = matchEntry(source, parent, root, compound[index], errorCollector);
|
|
181
|
+
if (result) {
|
|
182
|
+
if (onePassed) {
|
|
183
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("in compound \"single\": multiple matches succeeded");
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
onePassed = true;
|
|
187
|
+
}
|
|
221
188
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
function matchRecordItem(value, root, matcher) {
|
|
227
|
-
if ((0, base_1.isIterable)(matcher) && (0, base_1.isIterable)(value)) {
|
|
228
|
-
var it1 = value[Symbol.iterator]();
|
|
229
|
-
var it2 = matcher[Symbol.iterator]();
|
|
230
|
-
while (true) {
|
|
231
|
-
var v1 = it1.next();
|
|
232
|
-
var v2 = it2.next();
|
|
233
|
-
if (v1.done !== v2.done || v1.value !== v2.value) {
|
|
234
|
-
return false;
|
|
189
|
+
if (!onePassed) {
|
|
190
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("in compound \"single\": no matches succeeded");
|
|
235
191
|
}
|
|
236
|
-
|
|
237
|
-
|
|
192
|
+
return onePassed;
|
|
193
|
+
}
|
|
194
|
+
case 'some': {
|
|
195
|
+
// if any item matches, return true
|
|
196
|
+
while (++index < length) {
|
|
197
|
+
var result = matchEntry(source, parent, root, compound[index], errorCollector);
|
|
198
|
+
if (result) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
238
201
|
}
|
|
202
|
+
errorCollector === null || errorCollector === void 0 ? void 0 : errorCollector.push("in compound \"some\": no matches succeeded");
|
|
203
|
+
return false;
|
|
239
204
|
}
|
|
240
205
|
}
|
|
241
|
-
if ((0, base_1.isPlainObj)(value)) {
|
|
242
|
-
return matchOptions(value, root, matcher);
|
|
243
|
-
}
|
|
244
|
-
return Object.is(value, matcher);
|
|
245
206
|
}
|
|
246
207
|
//# sourceMappingURL=match.js.map
|
package/dist/main/match.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":";;;AAAA,oCAMqB;
|
|
1
|
+
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":";;;AAAA,oCAMqB;AAkIrB;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,KAAK,CACnB,MAAS,EACT,OAAoB,EACpB,cAAgD;IAAhD,+BAAA,EAAA,0BAAgD;IAEhD,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAc,EAAE,cAAc,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