@rimbu/deep 2.0.0 → 2.0.1
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/cjs/deep.cjs +197 -576
- package/dist/cjs/deep.cjs.map +1 -0
- package/dist/cjs/deep.d.cts +284 -0
- package/dist/cjs/index.cjs +18 -662
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +18 -0
- package/dist/cjs/internal.cjs +8 -582
- package/dist/cjs/internal.cjs.map +1 -0
- package/dist/cjs/internal.d.cts +7 -0
- package/dist/cjs/match.cjs +251 -343
- package/dist/cjs/match.cjs.map +1 -0
- package/dist/cjs/match.d.cts +140 -0
- package/dist/cjs/patch.cjs +121 -93
- package/dist/cjs/patch.cjs.map +1 -0
- package/dist/cjs/patch.d.cts +89 -0
- package/dist/cjs/path.cjs +114 -573
- package/dist/cjs/path.cjs.map +1 -0
- package/dist/cjs/path.d.cts +196 -0
- package/dist/cjs/protected.cjs +2 -17
- package/dist/cjs/protected.cjs.map +1 -0
- package/dist/cjs/selector.cjs +33 -574
- package/dist/cjs/selector.cjs.map +1 -0
- package/dist/cjs/selector.d.cts +47 -0
- package/dist/cjs/tuple.cjs +162 -71
- package/dist/cjs/tuple.cjs.map +1 -0
- package/dist/esm/protected.d.mts +17 -0
- package/dist/esm/tuple.d.mts +142 -0
- package/package.json +20 -14
- /package/dist/{types/protected.d.mts → cjs/protected.d.cts} +0 -0
- /package/dist/{types/tuple.d.mts → cjs/tuple.d.cts} +0 -0
- /package/dist/{types → esm}/deep.d.mts +0 -0
- /package/dist/{types → esm}/index.d.mts +0 -0
- /package/dist/{types → esm}/internal.d.mts +0 -0
- /package/dist/{types → esm}/match.d.mts +0 -0
- /package/dist/{types → esm}/patch.d.mts +0 -0
- /package/dist/{types → esm}/path.d.mts +0 -0
- /package/dist/{types → esm}/selector.d.mts +0 -0
package/dist/cjs/match.cjs
CHANGED
|
@@ -1,376 +1,284 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
module.exports = __toCommonJS(match_exports);
|
|
26
|
-
var import_base = require("@rimbu/base");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.match = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var base_1 = require("@rimbu/base");
|
|
6
|
+
/**
|
|
7
|
+
* Returns true if the given `value` object matches the given `matcher`, false otherwise.
|
|
8
|
+
* @typeparam T - the input value type
|
|
9
|
+
* @typeparam C - utility type
|
|
10
|
+
* @param source - the value to match (should be a plain object)
|
|
11
|
+
* @param matcher - a matcher object or a function taking the matcher API and returning a match object
|
|
12
|
+
* @param failureLog - (optional) a string array that can be passed to collect reasons why the match failed
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const input = { a: 1, b: { c: true, d: 'a' } }
|
|
16
|
+
* match(input, { a: 1 }) // => true
|
|
17
|
+
* match(input, { a: 2 }) // => false
|
|
18
|
+
* match(input, { a: (v) => v > 10 }) // => false
|
|
19
|
+
* match(input, { b: { c: true }}) // => true
|
|
20
|
+
* match(input, (['every', { a: (v) => v > 0 }, { b: { c: true } }]) // => true
|
|
21
|
+
* match(input, { b: { c: (v, parent, root) => v && parent.d.length > 0 && root.a > 0 } })
|
|
22
|
+
* // => true
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
27
25
|
function match(source, matcher, failureLog) {
|
|
28
|
-
|
|
26
|
+
return matchEntry(source, source, source, matcher, failureLog);
|
|
29
27
|
}
|
|
28
|
+
exports.match = match;
|
|
29
|
+
/**
|
|
30
|
+
* Match a generic match entry against the given source.
|
|
31
|
+
*/
|
|
30
32
|
function matchEntry(source, parent, root, matcher, failureLog) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (matcher === null || matcher === void 0) {
|
|
35
|
-
failureLog?.push(
|
|
36
|
-
`value ${JSON.stringify(source)} did not match matcher ${matcher}`
|
|
37
|
-
);
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
if (typeof source === "function") {
|
|
41
|
-
const result = Object.is(source, matcher);
|
|
42
|
-
if (!result) {
|
|
43
|
-
failureLog?.push(
|
|
44
|
-
`both value and matcher are functions, but they do not have the same reference`
|
|
45
|
-
);
|
|
33
|
+
if (Object.is(source, matcher)) {
|
|
34
|
+
// value and target are exactly the same, always will be true
|
|
35
|
+
return true;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (typeof matcherResult === "boolean") {
|
|
52
|
-
if (!matcherResult) {
|
|
53
|
-
failureLog?.push(
|
|
54
|
-
`function matcher returned false for value ${JSON.stringify(source)}`
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
return matcherResult;
|
|
58
|
-
}
|
|
59
|
-
return matchEntry(source, parent, root, matcherResult, failureLog);
|
|
60
|
-
}
|
|
61
|
-
if ((0, import_base.isPlainObj)(source)) {
|
|
62
|
-
return matchPlainObj(source, parent, root, matcher, failureLog);
|
|
63
|
-
}
|
|
64
|
-
if (Array.isArray(source)) {
|
|
65
|
-
return matchArr(source, parent, root, matcher, failureLog);
|
|
66
|
-
}
|
|
67
|
-
failureLog?.push(
|
|
68
|
-
`value ${JSON.stringify(
|
|
69
|
-
source
|
|
70
|
-
)} does not match given matcher ${JSON.stringify(matcher)}`
|
|
71
|
-
);
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
function matchArr(source, parent, root, matcher, failureLog) {
|
|
75
|
-
if (Array.isArray(matcher)) {
|
|
76
|
-
const length = source.length;
|
|
77
|
-
if (length !== matcher.length) {
|
|
78
|
-
failureLog?.push(
|
|
79
|
-
`array lengths are not equal: value length ${source.length} !== matcher length ${matcher.length}`
|
|
80
|
-
);
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
let index = -1;
|
|
84
|
-
while (++index < length) {
|
|
85
|
-
if (!matchEntry(source[index], source, root, matcher[index], failureLog)) {
|
|
86
|
-
failureLog?.push(
|
|
87
|
-
`index ${index} does not match with value ${JSON.stringify(
|
|
88
|
-
source[index]
|
|
89
|
-
)} and matcher ${matcher[index]}`
|
|
90
|
-
);
|
|
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
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("value ".concat(JSON.stringify(source), " did not match matcher ").concat(matcher));
|
|
91
41
|
return false;
|
|
92
|
-
}
|
|
93
42
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
root,
|
|
102
|
-
["every", ...matcher.every],
|
|
103
|
-
failureLog
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
if (`some` in matcher) {
|
|
107
|
-
return matchCompound(
|
|
108
|
-
source,
|
|
109
|
-
parent,
|
|
110
|
-
root,
|
|
111
|
-
["some", ...matcher.some],
|
|
112
|
-
failureLog
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
if (`none` in matcher) {
|
|
116
|
-
return matchCompound(
|
|
117
|
-
source,
|
|
118
|
-
parent,
|
|
119
|
-
root,
|
|
120
|
-
["none", ...matcher.none],
|
|
121
|
-
failureLog
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
if (`single` in matcher) {
|
|
125
|
-
return matchCompound(
|
|
126
|
-
source,
|
|
127
|
-
parent,
|
|
128
|
-
root,
|
|
129
|
-
["single", ...matcher.single],
|
|
130
|
-
failureLog
|
|
131
|
-
);
|
|
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
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("both value and matcher are functions, but they do not have the same reference");
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
132
50
|
}
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
source,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("function matcher returned false for value ".concat(JSON.stringify(source)));
|
|
58
|
+
}
|
|
59
|
+
return matcherResult;
|
|
60
|
+
}
|
|
61
|
+
// function resulted in a value that needs to be further matched
|
|
62
|
+
return matchEntry(source, parent, root, matcherResult, failureLog);
|
|
141
63
|
}
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
source,
|
|
145
|
-
root,
|
|
146
|
-
"everyItem",
|
|
147
|
-
matcher.everyItem,
|
|
148
|
-
failureLog
|
|
149
|
-
);
|
|
64
|
+
if ((0, base_1.isPlainObj)(source)) {
|
|
65
|
+
// source ia a plain object, can be partially matched
|
|
66
|
+
return matchPlainObj(source, parent, root, matcher, failureLog);
|
|
150
67
|
}
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
source,
|
|
154
|
-
root,
|
|
155
|
-
"noneItem",
|
|
156
|
-
matcher.noneItem,
|
|
157
|
-
failureLog
|
|
158
|
-
);
|
|
68
|
+
if (Array.isArray(source)) {
|
|
69
|
+
// source is an array
|
|
70
|
+
return matchArr(source, parent, root, matcher, failureLog);
|
|
159
71
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
72
|
+
// already determined above that the source and matcher are not equal
|
|
73
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.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, parent, root, matcher, failureLog) {
|
|
80
|
+
if (Array.isArray(matcher)) {
|
|
81
|
+
// directly compare array contents
|
|
82
|
+
var length = source.length;
|
|
83
|
+
if (length !== matcher.length) {
|
|
84
|
+
// if lengths not equal, arrays are not equal
|
|
85
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.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) {
|
|
91
|
+
if (!matchEntry(source[index], source, root, matcher[index], failureLog)) {
|
|
92
|
+
// item did not match, return false
|
|
93
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("index ".concat(index, " does not match with value ").concat(JSON.stringify(source[index]), " and matcher ").concat(matcher[index]));
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// all items are equal
|
|
98
|
+
return true;
|
|
168
99
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
100
|
+
// matcher is plain object
|
|
101
|
+
if (typeof matcher === 'object' && null !== matcher) {
|
|
102
|
+
if ("every" in matcher) {
|
|
103
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['every'], tslib_1.__read(matcher.every), false), failureLog);
|
|
104
|
+
}
|
|
105
|
+
if ("some" in matcher) {
|
|
106
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['some'], tslib_1.__read(matcher.some), false), failureLog);
|
|
107
|
+
}
|
|
108
|
+
if ("none" in matcher) {
|
|
109
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['none'], tslib_1.__read(matcher.none), false), failureLog);
|
|
110
|
+
}
|
|
111
|
+
if ("single" in matcher) {
|
|
112
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['single'], tslib_1.__read(matcher.single), false), failureLog);
|
|
113
|
+
}
|
|
114
|
+
if ("someItem" in matcher) {
|
|
115
|
+
return matchTraversal(source, root, 'someItem', matcher.someItem, failureLog);
|
|
116
|
+
}
|
|
117
|
+
if ("everyItem" in matcher) {
|
|
118
|
+
return matchTraversal(source, root, 'everyItem', matcher.everyItem, failureLog);
|
|
119
|
+
}
|
|
120
|
+
if ("noneItem" in matcher) {
|
|
121
|
+
return matchTraversal(source, root, 'noneItem', matcher.noneItem, failureLog);
|
|
122
|
+
}
|
|
123
|
+
if ("singleItem" in matcher) {
|
|
124
|
+
return matchTraversal(source, root, 'singleItem', matcher.singleItem, failureLog);
|
|
125
|
+
}
|
|
179
126
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
127
|
+
// matcher is plain object with index keys
|
|
128
|
+
for (var index in matcher) {
|
|
129
|
+
var matcherAtIndex = matcher[index];
|
|
130
|
+
if (!(index in source)) {
|
|
131
|
+
// source does not have item at given index
|
|
132
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("index ".concat(index, " does not exist in source ").concat(JSON.stringify(source), " but should match matcher ").concat(JSON.stringify(matcherAtIndex)));
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
// match the source item at the given index
|
|
136
|
+
var result = matchEntry(source[index], source, root, matcherAtIndex, failureLog);
|
|
137
|
+
if (!result) {
|
|
138
|
+
// item did not match
|
|
139
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("index ".concat(index, " does not match with value ").concat(JSON.stringify(source[index]), " and matcher ").concat(JSON.stringify(matcherAtIndex)));
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
194
142
|
}
|
|
195
|
-
|
|
196
|
-
|
|
143
|
+
// all items match
|
|
144
|
+
return true;
|
|
197
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Match an object matcher against the given source.
|
|
148
|
+
*/
|
|
198
149
|
function matchPlainObj(source, parent, root, matcher, failureLog) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
for (const key in matcher) {
|
|
203
|
-
if (!(key in source)) {
|
|
204
|
-
failureLog?.push(
|
|
205
|
-
`key ${key} is specified in matcher but not present in value ${JSON.stringify(
|
|
206
|
-
source
|
|
207
|
-
)}`
|
|
208
|
-
);
|
|
209
|
-
return false;
|
|
150
|
+
if (Array.isArray(matcher)) {
|
|
151
|
+
// the matcher is of compound type
|
|
152
|
+
return matchCompound(source, parent, root, matcher, failureLog);
|
|
210
153
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return false;
|
|
154
|
+
// partial object props matcher
|
|
155
|
+
for (var key in matcher) {
|
|
156
|
+
if (!(key in source)) {
|
|
157
|
+
// the source does not have the given key
|
|
158
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("key ".concat(key, " is specified in matcher but not present in value ").concat(JSON.stringify(source)));
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
// match the source value at the given key with the matcher at given key
|
|
162
|
+
var result = matchEntry(source[key], source, root, matcher[key], failureLog);
|
|
163
|
+
if (!result) {
|
|
164
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("key ".concat(key, " does not match in value ").concat(JSON.stringify(source[key]), " with matcher ").concat(JSON.stringify(matcher[key])));
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
225
167
|
}
|
|
226
|
-
|
|
227
|
-
|
|
168
|
+
// all properties match
|
|
169
|
+
return true;
|
|
228
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Match a compound matcher against the given source.
|
|
173
|
+
*/
|
|
229
174
|
function matchCompound(source, parent, root, compound, failureLog) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
);
|
|
247
|
-
return false;
|
|
175
|
+
// first item indicates compound match type
|
|
176
|
+
var matchType = compound[0];
|
|
177
|
+
var length = compound.length;
|
|
178
|
+
// start at index 1
|
|
179
|
+
var index = 0;
|
|
180
|
+
switch (matchType) {
|
|
181
|
+
case 'every': {
|
|
182
|
+
while (++index < length) {
|
|
183
|
+
// if any item does not match, return false
|
|
184
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
185
|
+
if (!result) {
|
|
186
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"every\": match at index ".concat(index, " failed"));
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
248
191
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
failureLog
|
|
260
|
-
);
|
|
261
|
-
if (result) {
|
|
262
|
-
failureLog?.push(
|
|
263
|
-
`in compound "none": match at index ${index} succeeded`
|
|
264
|
-
);
|
|
265
|
-
return false;
|
|
192
|
+
case 'none': {
|
|
193
|
+
// if any item matches, return false
|
|
194
|
+
while (++index < length) {
|
|
195
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
196
|
+
if (result) {
|
|
197
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"none\": match at index ".concat(index, " succeeded"));
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
266
202
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
);
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
onePassed = true;
|
|
203
|
+
case 'single': {
|
|
204
|
+
// if not exactly one item matches, return false
|
|
205
|
+
var onePassed = false;
|
|
206
|
+
while (++index < length) {
|
|
207
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
208
|
+
if (result) {
|
|
209
|
+
if (onePassed) {
|
|
210
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"single\": multiple matches succeeded");
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
onePassed = true;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (!onePassed) {
|
|
217
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"single\": no matches succeeded");
|
|
218
|
+
}
|
|
219
|
+
return onePassed;
|
|
288
220
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
parent,
|
|
300
|
-
root,
|
|
301
|
-
compound[index],
|
|
302
|
-
failureLog
|
|
303
|
-
);
|
|
304
|
-
if (result) {
|
|
305
|
-
return true;
|
|
221
|
+
case 'some': {
|
|
222
|
+
// if any item matches, return true
|
|
223
|
+
while (++index < length) {
|
|
224
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
225
|
+
if (result) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"some\": no matches succeeded");
|
|
230
|
+
return false;
|
|
306
231
|
}
|
|
307
|
-
}
|
|
308
|
-
failureLog?.push(`in compound "some": no matches succeeded`);
|
|
309
|
-
return false;
|
|
310
232
|
}
|
|
311
|
-
}
|
|
312
233
|
}
|
|
313
234
|
function matchTraversal(source, root, matchType, matcher, failureLog) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
235
|
+
var index = -1;
|
|
236
|
+
var length = source.length;
|
|
237
|
+
switch (matchType) {
|
|
238
|
+
case 'someItem': {
|
|
239
|
+
while (++index < length) {
|
|
240
|
+
if (matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"someItem\": no items matched given matcher");
|
|
245
|
+
return false;
|
|
321
246
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (!matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
331
|
-
failureLog?.push(
|
|
332
|
-
`in array traversal "everyItem": at least one item did not match given matcher`
|
|
333
|
-
);
|
|
334
|
-
return false;
|
|
247
|
+
case 'everyItem': {
|
|
248
|
+
while (++index < length) {
|
|
249
|
+
if (!matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
250
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"everyItem\": at least one item did not match given matcher");
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return true;
|
|
335
255
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
);
|
|
345
|
-
return false;
|
|
256
|
+
case 'noneItem': {
|
|
257
|
+
while (++index < length) {
|
|
258
|
+
if (matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
259
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"noneItem\": at least one item matched given matcher");
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return true;
|
|
346
264
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
265
|
+
case 'singleItem': {
|
|
266
|
+
var singleMatched = false;
|
|
267
|
+
while (++index < length) {
|
|
268
|
+
if (matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
269
|
+
if (singleMatched) {
|
|
270
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"singleItem\": more than one item matched given matcher");
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
singleMatched = true;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (!singleMatched) {
|
|
277
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"singleItem\": no item matched given matcher");
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
return true;
|
|
361
281
|
}
|
|
362
|
-
}
|
|
363
|
-
if (!singleMatched) {
|
|
364
|
-
failureLog?.push(
|
|
365
|
-
`in array traversal "singleItem": no item matched given matcher`
|
|
366
|
-
);
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
return true;
|
|
370
282
|
}
|
|
371
|
-
}
|
|
372
283
|
}
|
|
373
|
-
|
|
374
|
-
0 && (module.exports = {
|
|
375
|
-
match
|
|
376
|
-
});
|
|
284
|
+
//# sourceMappingURL=match.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.cjs","sourceRoot":"","sources":["../../_cjs_prepare/match.cts"],"names":[],"mappings":";;;;AAAA,oCAMqB;AA0KrB;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,KAAK,CACnB,MAAS,EACT,OAAoB,EACpB,UAA6B;IAE7B,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAc,EAAE,UAAU,CAAC,CAAC;AACxE,CAAC;AAND,sBAMC;AAED;;GAEG;AACH,SAAS,UAAU,CACjB,MAAS,EACT,MAAS,EACT,IAAO,EACP,OAAgC,EAChC,UAA6B;IAE7B,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAC/B,6DAA6D;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,mFAAmF;QACnF,qBAAqB;QACrB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CACd,gBAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,oCAA0B,OAAO,CAAE,CACnE,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,s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