tyneq 1.0.2 → 1.0.3
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/index.cjs
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunkTL2APXKNcjs = require('./chunk-TL2APXKN.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
@@ -57,7 +57,7 @@ var _chunkC5PBY3ZUcjs = require('./chunk-C5PBY3ZU.cjs');
|
|
|
57
57
|
var _chunkOWKUE3ACcjs = require('./chunk-OWKUE3AC.cjs');
|
|
58
58
|
|
|
59
59
|
// src/core/generators/range.ts
|
|
60
|
-
var RangeEnumerator = class extends
|
|
60
|
+
var RangeEnumerator = class extends _chunkTL2APXKNcjs.TyneqBaseEnumerator {
|
|
61
61
|
constructor(start, end) {
|
|
62
62
|
super();
|
|
63
63
|
this.current = start;
|
|
@@ -72,7 +72,7 @@ var RangeEnumerator = class extends _chunkVJAICXA6cjs.TyneqBaseEnumerator {
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
// src/core/generators/random.ts
|
|
75
|
-
var RandomEnumerator = class extends
|
|
75
|
+
var RandomEnumerator = class extends _chunkTL2APXKNcjs.TyneqBaseEnumerator {
|
|
76
76
|
constructor(count, randomizer) {
|
|
77
77
|
super();
|
|
78
78
|
this.yieldedCount = 0;
|
|
@@ -104,7 +104,7 @@ var EnumerableAdapter = class {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
// src/core/generators/repeat.ts
|
|
107
|
-
var RepeatEnumerator = class extends
|
|
107
|
+
var RepeatEnumerator = class extends _chunkTL2APXKNcjs.TyneqBaseEnumerator {
|
|
108
108
|
constructor(value, count) {
|
|
109
109
|
super();
|
|
110
110
|
this.yieldedCount = 0;
|
|
@@ -121,7 +121,7 @@ var RepeatEnumerator = class extends _chunkVJAICXA6cjs.TyneqBaseEnumerator {
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
// src/core/generators/generate.ts
|
|
124
|
-
var GenerateEnumerator = class extends
|
|
124
|
+
var GenerateEnumerator = class extends _chunkTL2APXKNcjs.TyneqBaseEnumerator {
|
|
125
125
|
constructor(seed, next, count) {
|
|
126
126
|
super();
|
|
127
127
|
this.yieldedCount = 0;
|
|
@@ -142,7 +142,7 @@ var GenerateEnumerator = class extends _chunkVJAICXA6cjs.TyneqBaseEnumerator {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
// src/core/generators/sourceConcat.ts
|
|
145
|
-
var SourceConcatEnumerator = class extends
|
|
145
|
+
var SourceConcatEnumerator = class extends _chunkTL2APXKNcjs.TyneqBaseEnumerator {
|
|
146
146
|
constructor(...sources) {
|
|
147
147
|
super();
|
|
148
148
|
this.currentSourceIndex = 0;
|
|
@@ -175,14 +175,14 @@ var SourceConcatEnumerator = class extends _chunkVJAICXA6cjs.TyneqBaseEnumerator
|
|
|
175
175
|
|
|
176
176
|
// src/core/tyneq.ts
|
|
177
177
|
var _concat_dec, _generate_dec, _repeat_dec, _empty_dec, _range_dec, _random_dec, _from_dec, _init;
|
|
178
|
-
_from_dec = [
|
|
178
|
+
_from_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })], _random_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })], _range_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })], _empty_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })], _repeat_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })], _generate_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })], _concat_dec = [_chunkTL2APXKNcjs.source.call(void 0, { source: "internal" })];
|
|
179
179
|
var _Tyneq = class _Tyneq {
|
|
180
180
|
static from(source2) {
|
|
181
181
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNotOptional({ source: source2 });
|
|
182
182
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkIterable({ source: source2 });
|
|
183
183
|
const sourceKind = _Tyneq.resolveSourceKind(source2);
|
|
184
184
|
const adapter = new EnumerableAdapter(source2);
|
|
185
|
-
return new (0,
|
|
185
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)(adapter, new (0, _chunkTL2APXKNcjs.QueryNode)("from", [source2], null, "source", sourceKind));
|
|
186
186
|
}
|
|
187
187
|
static resolveSourceKind(source2) {
|
|
188
188
|
if (Array.isArray(source2)) return "array";
|
|
@@ -195,9 +195,9 @@ var _Tyneq = class _Tyneq {
|
|
|
195
195
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNonNegative({ count });
|
|
196
196
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkInteger({ count });
|
|
197
197
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNotOptional({ randomizer });
|
|
198
|
-
return new (0,
|
|
198
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)({
|
|
199
199
|
getEnumerator: () => new RandomEnumerator(count, randomizer)
|
|
200
|
-
}, new (0,
|
|
200
|
+
}, new (0, _chunkTL2APXKNcjs.QueryNode)("random", [count, randomizer], null, "source"));
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
* Returns `true` if `source` is `null`, `undefined`, or an iterable whose first element is `null` or `undefined`.
|
|
@@ -212,22 +212,22 @@ var _Tyneq = class _Tyneq {
|
|
|
212
212
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNonNegative({ count });
|
|
213
213
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkInteger({ count });
|
|
214
214
|
const end = start + count - 1;
|
|
215
|
-
return new (0,
|
|
215
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)({
|
|
216
216
|
getEnumerator: () => new RangeEnumerator(start, end)
|
|
217
|
-
}, new (0,
|
|
217
|
+
}, new (0, _chunkTL2APXKNcjs.QueryNode)("range", [start, count], null, "source"));
|
|
218
218
|
}
|
|
219
219
|
static empty() {
|
|
220
|
-
return new (0,
|
|
220
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)(
|
|
221
221
|
new EnumerableAdapter([]),
|
|
222
|
-
new (0,
|
|
222
|
+
new (0, _chunkTL2APXKNcjs.QueryNode)("empty", [], null, "source")
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
static repeat(value, count) {
|
|
226
226
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNonNegative({ count });
|
|
227
227
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkInteger({ count });
|
|
228
|
-
return new (0,
|
|
228
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)({
|
|
229
229
|
getEnumerator: () => new RepeatEnumerator(value, count)
|
|
230
|
-
}, new (0,
|
|
230
|
+
}, new (0, _chunkTL2APXKNcjs.QueryNode)("repeat", [value, count], null, "source"));
|
|
231
231
|
}
|
|
232
232
|
static generate(seed, next, count) {
|
|
233
233
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNotOptional({ next });
|
|
@@ -235,18 +235,18 @@ var _Tyneq = class _Tyneq {
|
|
|
235
235
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNonNegative({ count });
|
|
236
236
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkInteger({ count });
|
|
237
237
|
}
|
|
238
|
-
return new (0,
|
|
238
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)({
|
|
239
239
|
getEnumerator: () => new GenerateEnumerator(seed, next, count)
|
|
240
|
-
}, new (0,
|
|
240
|
+
}, new (0, _chunkTL2APXKNcjs.QueryNode)("generate", [seed, next, count], null, "source"));
|
|
241
241
|
}
|
|
242
242
|
static concat(...sources) {
|
|
243
243
|
for (const source2 of sources) {
|
|
244
244
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkNotOptional({ source: source2 });
|
|
245
245
|
_chunkOWKUE3ACcjs.ArgumentUtility.checkIterable({ source: source2 });
|
|
246
246
|
}
|
|
247
|
-
return new (0,
|
|
247
|
+
return new (0, _chunkTL2APXKNcjs.TyneqEnumerable)({
|
|
248
248
|
getEnumerator: () => new SourceConcatEnumerator(...sources)
|
|
249
|
-
}, new (0,
|
|
249
|
+
}, new (0, _chunkTL2APXKNcjs.QueryNode)("concat", sources, null, "source"));
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
252
252
|
* Pairs each element with its zero-based index.
|
|
@@ -443,7 +443,7 @@ var QueryPlanTransformer = class {
|
|
|
443
443
|
* @param source - The transformed predecessor, or `null` for source nodes.
|
|
444
444
|
*/
|
|
445
445
|
transformNode(node, source2) {
|
|
446
|
-
return new (0,
|
|
446
|
+
return new (0, _chunkTL2APXKNcjs.QueryNode)(node.operatorName, node.args, source2, node.category, node.sourceKind);
|
|
447
447
|
}
|
|
448
448
|
};
|
|
449
449
|
|
|
@@ -465,7 +465,7 @@ var QueryPlanOptimizer = class extends QueryPlanTransformer {
|
|
|
465
465
|
const predA = source2.args[0];
|
|
466
466
|
const predB = node.args[0];
|
|
467
467
|
const fused = (x) => predA(x) && predB(x);
|
|
468
|
-
return new (0,
|
|
468
|
+
return new (0, _chunkTL2APXKNcjs.QueryNode)("where", [fused], source2.source, "streaming");
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
471
|
* @remarks Fusion is only semantics-preserving for pure, side-effect-free projections.
|
|
@@ -474,7 +474,7 @@ var QueryPlanOptimizer = class extends QueryPlanTransformer {
|
|
|
474
474
|
const projA = source2.args[0];
|
|
475
475
|
const projB = node.args[0];
|
|
476
476
|
const fused = (x) => projB(projA(x));
|
|
477
|
-
return new (0,
|
|
477
|
+
return new (0, _chunkTL2APXKNcjs.QueryNode)("select", [fused], source2.source, "streaming");
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
480
|
|
|
@@ -559,7 +559,7 @@ var QueryPlanCompiler = class {
|
|
|
559
559
|
return this.applyOperator(this.compileNode(node.source, options), node);
|
|
560
560
|
}
|
|
561
561
|
compileSource(node, options) {
|
|
562
|
-
const entry =
|
|
562
|
+
const entry = _chunkTL2APXKNcjs.OperatorRegistry.getSource(node.operatorName);
|
|
563
563
|
if (!entry) {
|
|
564
564
|
throw new CompilerError(
|
|
565
565
|
`Unknown source operator "${node.operatorName}". Register it via OperatorRegistry.registerSource() before compiling.`,
|
|
@@ -575,7 +575,7 @@ var QueryPlanCompiler = class {
|
|
|
575
575
|
const entry = this.findOperatorEntry(node.operatorName, source2);
|
|
576
576
|
if (!entry) {
|
|
577
577
|
const sourceType = source2 !== null && source2 !== void 0 ? (_c = (_b = (_a = Object.getPrototypeOf(source2)) == null ? void 0 : _a.constructor) == null ? void 0 : _b.name) != null ? _c : typeof source2 : "null";
|
|
578
|
-
const knownForAnyTarget =
|
|
578
|
+
const knownForAnyTarget = _chunkTL2APXKNcjs.OperatorRegistry.hasOperator(node.operatorName);
|
|
579
579
|
const message = knownForAnyTarget ? `Operator "${node.operatorName}" is not registered for sequence type ${sourceType}. Ensure the source sequence is of the correct type for this operator.` : `Operator "${node.operatorName}" is not registered. Register it via @operator, createOperator, or createGeneratorOperator before compiling.`;
|
|
580
580
|
throw new CompilerError(message, "operator", node.operatorName);
|
|
581
581
|
}
|
|
@@ -590,7 +590,7 @@ var QueryPlanCompiler = class {
|
|
|
590
590
|
while (proto !== null) {
|
|
591
591
|
const ctor = proto.constructor;
|
|
592
592
|
if (ctor !== void 0) {
|
|
593
|
-
const entry =
|
|
593
|
+
const entry = _chunkTL2APXKNcjs.OperatorRegistry.getOperator(operatorName, ctor);
|
|
594
594
|
if (entry !== void 0) {
|
|
595
595
|
return entry;
|
|
596
596
|
}
|
|
@@ -655,4 +655,4 @@ var QueryPlanCompiler = class {
|
|
|
655
655
|
|
|
656
656
|
|
|
657
657
|
|
|
658
|
-
exports.ArgumentError = _chunkOWKUE3ACcjs.ArgumentError; exports.ArgumentNullError = _chunkOWKUE3ACcjs.ArgumentNullError; exports.ArgumentOutOfRangeError = _chunkOWKUE3ACcjs.ArgumentOutOfRangeError; exports.ArgumentTypeError = _chunkOWKUE3ACcjs.ArgumentTypeError; exports.ArgumentUtility = _chunkOWKUE3ACcjs.ArgumentUtility; exports.CompilerError = CompilerError; exports.InvalidOperationError =
|
|
658
|
+
exports.ArgumentError = _chunkOWKUE3ACcjs.ArgumentError; exports.ArgumentNullError = _chunkOWKUE3ACcjs.ArgumentNullError; exports.ArgumentOutOfRangeError = _chunkOWKUE3ACcjs.ArgumentOutOfRangeError; exports.ArgumentTypeError = _chunkOWKUE3ACcjs.ArgumentTypeError; exports.ArgumentUtility = _chunkOWKUE3ACcjs.ArgumentUtility; exports.CompilerError = CompilerError; exports.InvalidOperationError = _chunkTL2APXKNcjs.InvalidOperationError; exports.KeyNotFoundError = KeyNotFoundError; exports.Lazy = _chunkOWKUE3ACcjs.Lazy; exports.NotSupportedError = NotSupportedError; exports.OperatorMetadata = _chunkTL2APXKNcjs.OperatorMetadata; exports.OperatorRegistry = _chunkTL2APXKNcjs.OperatorRegistry; exports.PluginError = _chunkTL2APXKNcjs.PluginError; exports.QueryNode = _chunkTL2APXKNcjs.QueryNode; exports.QueryPlanCompiler = QueryPlanCompiler; exports.QueryPlanOptimizer = QueryPlanOptimizer; exports.QueryPlanPrinter = QueryPlanPrinter; exports.QueryPlanTransformer = QueryPlanTransformer; exports.QueryPlanWalker = QueryPlanWalker; exports.ReflectionContext = _chunkOWKUE3ACcjs.ReflectionContext; exports.ReflectionError = _chunkOWKUE3ACcjs.ReflectionError; exports.RegistryError = _chunkTL2APXKNcjs.RegistryError; exports.SequenceContainsNoElementsError = _chunkTL2APXKNcjs.SequenceContainsNoElementsError; exports.Tyneq = Tyneq; exports.TyneqBaseEnumerator = _chunkTL2APXKNcjs.TyneqBaseEnumerator; exports.TyneqCachedEnumerable = _chunkTL2APXKNcjs.TyneqCachedEnumerable; exports.TyneqCachedEnumerator = _chunkTL2APXKNcjs.TyneqCachedEnumerator; exports.TyneqCachedTerminalOperator = _chunkTL2APXKNcjs.TyneqCachedTerminalOperator; exports.TyneqComparer = _chunkTL2APXKNcjs.TyneqComparer; exports.TyneqEnumerator = _chunkTL2APXKNcjs.TyneqEnumerator; exports.TyneqError = _chunkOWKUE3ACcjs.TyneqError; exports.TyneqOrderedEnumerable = _chunkTL2APXKNcjs.TyneqOrderedEnumerable; exports.TyneqOrderedEnumerator = _chunkTL2APXKNcjs.TyneqOrderedEnumerator; exports.TyneqOrderedTerminalOperator = _chunkTL2APXKNcjs.TyneqOrderedTerminalOperator; exports.TyneqTerminalOperator = _chunkTL2APXKNcjs.TyneqTerminalOperator; exports.TypeGuardUtility = _chunkOWKUE3ACcjs.TypeGuardUtility; exports.ValidationBuilder = _chunkC5PBY3ZUcjs.ValidationBuilder; exports.ValidationError = _chunkC5PBY3ZUcjs.ValidationError; exports.cachedOperator = _chunkTL2APXKNcjs.cachedOperator; exports.cachedTerminal = _chunkTL2APXKNcjs.cachedTerminal; exports.createCachedOperator = _chunkTL2APXKNcjs.createCachedOperator; exports.createCachedTerminalOperator = _chunkTL2APXKNcjs.createCachedTerminalOperator; exports.createGeneratorOperator = _chunkTL2APXKNcjs.createGeneratorOperator; exports.createOperator = _chunkTL2APXKNcjs.createOperator; exports.createOrderedOperator = _chunkTL2APXKNcjs.createOrderedOperator; exports.createOrderedTerminalOperator = _chunkTL2APXKNcjs.createOrderedTerminalOperator; exports.createTerminalOperator = _chunkTL2APXKNcjs.createTerminalOperator; exports.isSourceNode = _chunkTL2APXKNcjs.isSourceNode; exports.operator = _chunkTL2APXKNcjs.operator; exports.orderedOperator = _chunkTL2APXKNcjs.orderedOperator; exports.orderedTerminal = _chunkTL2APXKNcjs.orderedTerminal; exports.reflect = _chunkOWKUE3ACcjs.reflect; exports.terminal = _chunkTL2APXKNcjs.terminal; exports.tyneqQueryNode = _chunkTL2APXKNcjs.tyneqQueryNode;
|
package/dist/index.js
CHANGED
package/dist/plugin/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkTL2APXKNcjs = require('../chunk-TL2APXKN.cjs');
|
|
26
26
|
require('../chunk-OWKUE3AC.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -48,4 +48,4 @@ require('../chunk-OWKUE3AC.cjs');
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
exports.EnumeratorUtility =
|
|
51
|
+
exports.EnumeratorUtility = _chunkTL2APXKNcjs.EnumeratorUtility; exports.OperatorRegistry = _chunkTL2APXKNcjs.OperatorRegistry; exports.TyneqBaseEnumerator = _chunkTL2APXKNcjs.TyneqBaseEnumerator; exports.TyneqCachedEnumerator = _chunkTL2APXKNcjs.TyneqCachedEnumerator; exports.TyneqCachedTerminalOperator = _chunkTL2APXKNcjs.TyneqCachedTerminalOperator; exports.TyneqEnumerator = _chunkTL2APXKNcjs.TyneqEnumerator; exports.TyneqOrderedEnumerator = _chunkTL2APXKNcjs.TyneqOrderedEnumerator; exports.TyneqOrderedTerminalOperator = _chunkTL2APXKNcjs.TyneqOrderedTerminalOperator; exports.TyneqTerminalOperator = _chunkTL2APXKNcjs.TyneqTerminalOperator; exports.cachedOperator = _chunkTL2APXKNcjs.cachedOperator; exports.cachedTerminal = _chunkTL2APXKNcjs.cachedTerminal; exports.createCachedOperator = _chunkTL2APXKNcjs.createCachedOperator; exports.createCachedTerminalOperator = _chunkTL2APXKNcjs.createCachedTerminalOperator; exports.createGeneratorOperator = _chunkTL2APXKNcjs.createGeneratorOperator; exports.createOperator = _chunkTL2APXKNcjs.createOperator; exports.createOrderedOperator = _chunkTL2APXKNcjs.createOrderedOperator; exports.createOrderedTerminalOperator = _chunkTL2APXKNcjs.createOrderedTerminalOperator; exports.createTerminalOperator = _chunkTL2APXKNcjs.createTerminalOperator; exports.operator = _chunkTL2APXKNcjs.operator; exports.orderedOperator = _chunkTL2APXKNcjs.orderedOperator; exports.orderedTerminal = _chunkTL2APXKNcjs.orderedTerminal; exports.source = _chunkTL2APXKNcjs.source; exports.terminal = _chunkTL2APXKNcjs.terminal;
|
package/dist/plugin/index.js
CHANGED