@rimbu/deep 2.0.0 → 2.0.2
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/README.md +37 -27
- package/dist/bun/deep.mts +2 -2
- package/dist/bun/match.mts +27 -25
- package/dist/bun/patch.mts +10 -9
- package/dist/bun/path.mts +94 -95
- package/dist/bun/protected.mts +18 -17
- package/dist/bun/selector.mts +22 -20
- package/dist/bun/tuple.mts +1 -1
- 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 +250 -343
- package/dist/cjs/match.cjs.map +1 -0
- package/dist/cjs/match.d.cts +140 -0
- package/dist/cjs/patch.cjs +120 -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 +199 -0
- package/dist/cjs/protected.cjs +2 -17
- package/dist/cjs/protected.cjs.map +1 -0
- package/dist/cjs/selector.cjs +32 -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/match.mjs.map +1 -1
- package/dist/esm/patch.mjs.map +1 -1
- package/dist/{types → esm}/path.d.mts +4 -1
- package/dist/esm/path.mjs.map +1 -1
- package/dist/esm/protected.d.mts +17 -0
- package/dist/esm/selector.mjs.map +1 -1
- package/dist/esm/tuple.d.mts +142 -0
- package/package.json +20 -14
- package/src/deep.mts +2 -2
- package/src/match.mts +27 -25
- package/src/patch.mts +10 -9
- package/src/path.mts +94 -95
- package/src/protected.mts +18 -17
- package/src/selector.mts +22 -20
- package/src/tuple.mts +1 -1
- /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}/selector.d.mts +0 -0
package/dist/cjs/match.cjs
CHANGED
|
@@ -1,376 +1,283 @@
|
|
|
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 = match;
|
|
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
|
+
/**
|
|
29
|
+
* Match a generic match entry against the given source.
|
|
30
|
+
*/
|
|
30
31
|
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
|
-
);
|
|
32
|
+
if (Object.is(source, matcher)) {
|
|
33
|
+
// value and target are exactly the same, always will be true
|
|
34
|
+
return true;
|
|
46
35
|
}
|
|
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
|
-
);
|
|
36
|
+
if (matcher === null || matcher === undefined) {
|
|
37
|
+
// these matchers can only be direct matches, and previously it was determined that
|
|
38
|
+
// they are not equal
|
|
39
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("value ".concat(JSON.stringify(source), " did not match matcher ").concat(matcher));
|
|
91
40
|
return false;
|
|
92
|
-
}
|
|
93
41
|
}
|
|
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
|
-
);
|
|
42
|
+
if (typeof source === 'function') {
|
|
43
|
+
// function source values can only be directly matched
|
|
44
|
+
var result = Object.is(source, matcher);
|
|
45
|
+
if (!result) {
|
|
46
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("both value and matcher are functions, but they do not have the same reference");
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
132
49
|
}
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
source,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
50
|
+
if (typeof matcher === 'function') {
|
|
51
|
+
// resolve match function first
|
|
52
|
+
var matcherResult = matcher(source, parent, root);
|
|
53
|
+
if (typeof matcherResult === 'boolean') {
|
|
54
|
+
// function resulted in a direct match result
|
|
55
|
+
if (!matcherResult) {
|
|
56
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("function matcher returned false for value ".concat(JSON.stringify(source)));
|
|
57
|
+
}
|
|
58
|
+
return matcherResult;
|
|
59
|
+
}
|
|
60
|
+
// function resulted in a value that needs to be further matched
|
|
61
|
+
return matchEntry(source, parent, root, matcherResult, failureLog);
|
|
141
62
|
}
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
source,
|
|
145
|
-
root,
|
|
146
|
-
"everyItem",
|
|
147
|
-
matcher.everyItem,
|
|
148
|
-
failureLog
|
|
149
|
-
);
|
|
63
|
+
if ((0, base_1.isPlainObj)(source)) {
|
|
64
|
+
// source ia a plain object, can be partially matched
|
|
65
|
+
return matchPlainObj(source, parent, root, matcher, failureLog);
|
|
150
66
|
}
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
source,
|
|
154
|
-
root,
|
|
155
|
-
"noneItem",
|
|
156
|
-
matcher.noneItem,
|
|
157
|
-
failureLog
|
|
158
|
-
);
|
|
67
|
+
if (Array.isArray(source)) {
|
|
68
|
+
// source is an array
|
|
69
|
+
return matchArr(source, parent, root, matcher, failureLog);
|
|
159
70
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
71
|
+
// already determined above that the source and matcher are not equal
|
|
72
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("value ".concat(JSON.stringify(source), " does not match given matcher ").concat(JSON.stringify(matcher)));
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Match an array matcher against the given source.
|
|
77
|
+
*/
|
|
78
|
+
function matchArr(source, parent, root, matcher, failureLog) {
|
|
79
|
+
if (Array.isArray(matcher)) {
|
|
80
|
+
// directly compare array contents
|
|
81
|
+
var length = source.length;
|
|
82
|
+
if (length !== matcher.length) {
|
|
83
|
+
// if lengths not equal, arrays are not equal
|
|
84
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("array lengths are not equal: value length ".concat(source.length, " !== matcher length ").concat(matcher.length));
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
// loop over arrays, matching every value
|
|
88
|
+
var index = -1;
|
|
89
|
+
while (++index < length) {
|
|
90
|
+
if (!matchEntry(source[index], source, root, matcher[index], failureLog)) {
|
|
91
|
+
// item did not match, return false
|
|
92
|
+
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]));
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// all items are equal
|
|
97
|
+
return true;
|
|
168
98
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
99
|
+
// matcher is plain object
|
|
100
|
+
if (typeof matcher === 'object' && null !== matcher) {
|
|
101
|
+
if ("every" in matcher) {
|
|
102
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['every'], tslib_1.__read(matcher.every), false), failureLog);
|
|
103
|
+
}
|
|
104
|
+
if ("some" in matcher) {
|
|
105
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['some'], tslib_1.__read(matcher.some), false), failureLog);
|
|
106
|
+
}
|
|
107
|
+
if ("none" in matcher) {
|
|
108
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['none'], tslib_1.__read(matcher.none), false), failureLog);
|
|
109
|
+
}
|
|
110
|
+
if ("single" in matcher) {
|
|
111
|
+
return matchCompound(source, parent, root, tslib_1.__spreadArray(['single'], tslib_1.__read(matcher.single), false), failureLog);
|
|
112
|
+
}
|
|
113
|
+
if ("someItem" in matcher) {
|
|
114
|
+
return matchTraversal(source, root, 'someItem', matcher.someItem, failureLog);
|
|
115
|
+
}
|
|
116
|
+
if ("everyItem" in matcher) {
|
|
117
|
+
return matchTraversal(source, root, 'everyItem', matcher.everyItem, failureLog);
|
|
118
|
+
}
|
|
119
|
+
if ("noneItem" in matcher) {
|
|
120
|
+
return matchTraversal(source, root, 'noneItem', matcher.noneItem, failureLog);
|
|
121
|
+
}
|
|
122
|
+
if ("singleItem" in matcher) {
|
|
123
|
+
return matchTraversal(source, root, 'singleItem', matcher.singleItem, failureLog);
|
|
124
|
+
}
|
|
179
125
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
126
|
+
// matcher is plain object with index keys
|
|
127
|
+
for (var index in matcher) {
|
|
128
|
+
var matcherAtIndex = matcher[index];
|
|
129
|
+
if (!(index in source)) {
|
|
130
|
+
// source does not have item at given index
|
|
131
|
+
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)));
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
// match the source item at the given index
|
|
135
|
+
var result = matchEntry(source[index], source, root, matcherAtIndex, failureLog);
|
|
136
|
+
if (!result) {
|
|
137
|
+
// item did not match
|
|
138
|
+
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)));
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
194
141
|
}
|
|
195
|
-
|
|
196
|
-
|
|
142
|
+
// all items match
|
|
143
|
+
return true;
|
|
197
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Match an object matcher against the given source.
|
|
147
|
+
*/
|
|
198
148
|
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;
|
|
149
|
+
if (Array.isArray(matcher)) {
|
|
150
|
+
// the matcher is of compound type
|
|
151
|
+
return matchCompound(source, parent, root, matcher, failureLog);
|
|
210
152
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return false;
|
|
153
|
+
// partial object props matcher
|
|
154
|
+
for (var key in matcher) {
|
|
155
|
+
if (!(key in source)) {
|
|
156
|
+
// the source does not have the given key
|
|
157
|
+
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)));
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
// match the source value at the given key with the matcher at given key
|
|
161
|
+
var result = matchEntry(source[key], source, root, matcher[key], failureLog);
|
|
162
|
+
if (!result) {
|
|
163
|
+
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])));
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
225
166
|
}
|
|
226
|
-
|
|
227
|
-
|
|
167
|
+
// all properties match
|
|
168
|
+
return true;
|
|
228
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Match a compound matcher against the given source.
|
|
172
|
+
*/
|
|
229
173
|
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;
|
|
174
|
+
// first item indicates compound match type
|
|
175
|
+
var matchType = compound[0];
|
|
176
|
+
var length = compound.length;
|
|
177
|
+
// start at index 1
|
|
178
|
+
var index = 0;
|
|
179
|
+
switch (matchType) {
|
|
180
|
+
case 'every': {
|
|
181
|
+
while (++index < length) {
|
|
182
|
+
// if any item does not match, return false
|
|
183
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
184
|
+
if (!result) {
|
|
185
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"every\": match at index ".concat(index, " failed"));
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return true;
|
|
248
190
|
}
|
|
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;
|
|
191
|
+
case 'none': {
|
|
192
|
+
// if any item matches, return false
|
|
193
|
+
while (++index < length) {
|
|
194
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
195
|
+
if (result) {
|
|
196
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"none\": match at index ".concat(index, " succeeded"));
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return true;
|
|
266
201
|
}
|
|
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;
|
|
202
|
+
case 'single': {
|
|
203
|
+
// if not exactly one item matches, return false
|
|
204
|
+
var onePassed = false;
|
|
205
|
+
while (++index < length) {
|
|
206
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
207
|
+
if (result) {
|
|
208
|
+
if (onePassed) {
|
|
209
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"single\": multiple matches succeeded");
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
onePassed = true;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (!onePassed) {
|
|
216
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"single\": no matches succeeded");
|
|
217
|
+
}
|
|
218
|
+
return onePassed;
|
|
288
219
|
}
|
|
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;
|
|
220
|
+
case 'some': {
|
|
221
|
+
// if any item matches, return true
|
|
222
|
+
while (++index < length) {
|
|
223
|
+
var result = matchEntry(source, parent, root, compound[index], failureLog);
|
|
224
|
+
if (result) {
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in compound \"some\": no matches succeeded");
|
|
229
|
+
return false;
|
|
306
230
|
}
|
|
307
|
-
}
|
|
308
|
-
failureLog?.push(`in compound "some": no matches succeeded`);
|
|
309
|
-
return false;
|
|
310
231
|
}
|
|
311
|
-
}
|
|
312
232
|
}
|
|
313
233
|
function matchTraversal(source, root, matchType, matcher, failureLog) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
234
|
+
var index = -1;
|
|
235
|
+
var length = source.length;
|
|
236
|
+
switch (matchType) {
|
|
237
|
+
case 'someItem': {
|
|
238
|
+
while (++index < length) {
|
|
239
|
+
if (matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"someItem\": no items matched given matcher");
|
|
244
|
+
return false;
|
|
321
245
|
}
|
|
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;
|
|
246
|
+
case 'everyItem': {
|
|
247
|
+
while (++index < length) {
|
|
248
|
+
if (!matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
249
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"everyItem\": at least one item did not match given matcher");
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return true;
|
|
335
254
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
);
|
|
345
|
-
return false;
|
|
255
|
+
case 'noneItem': {
|
|
256
|
+
while (++index < length) {
|
|
257
|
+
if (matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
258
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"noneItem\": at least one item matched given matcher");
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return true;
|
|
346
263
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
264
|
+
case 'singleItem': {
|
|
265
|
+
var singleMatched = false;
|
|
266
|
+
while (++index < length) {
|
|
267
|
+
if (matchEntry(source[index], source, root, matcher, failureLog)) {
|
|
268
|
+
if (singleMatched) {
|
|
269
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"singleItem\": more than one item matched given matcher");
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
singleMatched = true;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (!singleMatched) {
|
|
276
|
+
failureLog === null || failureLog === void 0 ? void 0 : failureLog.push("in array traversal \"singleItem\": no item matched given matcher");
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
return true;
|
|
361
280
|
}
|
|
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
281
|
}
|
|
371
|
-
}
|
|
372
282
|
}
|
|
373
|
-
|
|
374
|
-
0 && (module.exports = {
|
|
375
|
-
match
|
|
376
|
-
});
|
|
283
|
+
//# sourceMappingURL=match.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.cjs","sourceRoot":"","sources":["../../_cjs_prepare/match.cts"],"names":[],"mappings":";;AAyMA,sBAMC;;AA/MD,oCAMqB;AAgLrB;;;;;;;;;;;;;;;;;;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;AAED;;GAEG;AACH,SAAS,UAAU,CACjB,MAAS,EACT,MAAS,EACT,IAAO,EACP,OAAgC,EAChC,UAA6B;IAE7B,IAAI,MAAM,CAAC,EAAE,CAAC,M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