trilean 1.13.5 → 1.13.7
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/builtin-functions.cjs +1 -2
- package/dist/builtin-functions.d.cts +1 -3
- package/dist/builtin-functions.d.ts +1 -3
- package/dist/builtin-functions.js +1 -2
- package/dist/complex-division.cjs +1 -2
- package/dist/complex-division.d.cts +1 -3
- package/dist/complex-division.d.ts +1 -3
- package/dist/complex-division.js +1 -2
- package/dist/complex.cjs +1 -2
- package/dist/complex.d.cts +1 -3
- package/dist/complex.d.ts +1 -3
- package/dist/complex.js +1 -2
- package/dist/{computed-value-CbRF0Izc.d.cts → computed-value-CaFJ1YkU.d.ts} +0 -2
- package/dist/computed-value.cjs +1 -2
- package/dist/computed-value.d.cts +48 -2
- package/dist/computed-value.d.ts +1 -1
- package/dist/computed-value.js +1 -2
- package/dist/derived-aggregates.cjs +1 -2
- package/dist/derived-aggregates.d.cts +2 -4
- package/dist/derived-aggregates.d.ts +2 -4
- package/dist/derived-aggregates.js +1 -2
- package/dist/derived-connectives.cjs +1 -2
- package/dist/derived-connectives.d.cts +2 -4
- package/dist/derived-connectives.d.ts +2 -4
- package/dist/derived-connectives.js +1 -2
- package/dist/derived-patterns.cjs +1 -2
- package/dist/derived-patterns.d.cts +1 -3
- package/dist/derived-patterns.d.ts +1 -3
- package/dist/derived-patterns.js +1 -2
- package/dist/derived-values.cjs +1 -2
- package/dist/derived-values.d.cts +1 -3
- package/dist/derived-values.d.ts +1 -3
- package/dist/derived-values.js +1 -2
- package/dist/{dist-Dn-LI_AV.js → dist-ed78Tuwe.js} +2 -4
- package/dist/{dist-DO_3oafK.cjs → dist-ySX7cb5d.cjs} +2 -4
- package/dist/duration-order.cjs +1 -2
- package/dist/duration-order.d.cts +1 -3
- package/dist/duration-order.d.ts +1 -3
- package/dist/duration-order.js +1 -2
- package/dist/evaluate-document.cjs +4 -5
- package/dist/evaluate-document.d.cts +2 -4
- package/dist/evaluate-document.d.ts +2 -4
- package/dist/evaluate-document.js +4 -5
- package/dist/evaluation.cjs +1 -2
- package/dist/evaluation.d.cts +1 -3
- package/dist/evaluation.d.ts +1 -3
- package/dist/evaluation.js +1 -2
- package/dist/evaluator-budget.cjs +1 -2
- package/dist/evaluator-budget.d.cts +1 -3
- package/dist/evaluator-budget.d.ts +1 -3
- package/dist/evaluator-budget.js +1 -2
- package/dist/evaluator-collection.cjs +1 -2
- package/dist/evaluator-collection.d.cts +5 -7
- package/dist/evaluator-collection.d.ts +5 -7
- package/dist/evaluator-collection.js +1 -2
- package/dist/evaluator-compiled.cjs +3 -4
- package/dist/evaluator-compiled.d.cts +3 -5
- package/dist/evaluator-compiled.d.ts +3 -5
- package/dist/evaluator-compiled.js +3 -4
- package/dist/evaluator-effect.cjs +1 -2
- package/dist/evaluator-effect.d.cts +0 -2
- package/dist/evaluator-effect.d.ts +0 -2
- package/dist/evaluator-effect.js +1 -2
- package/dist/evaluator-factory.cjs +2 -3
- package/dist/evaluator-factory.d.cts +5 -7
- package/dist/evaluator-factory.d.ts +5 -7
- package/dist/evaluator-factory.js +2 -3
- package/dist/evaluator-indeterminacy-helpers.cjs +2 -3
- package/dist/evaluator-indeterminacy-helpers.d.cts +2 -4
- package/dist/evaluator-indeterminacy-helpers.d.ts +2 -4
- package/dist/evaluator-indeterminacy-helpers.js +2 -3
- package/dist/evaluator-literals.cjs +1 -2
- package/dist/evaluator-literals.d.cts +2 -4
- package/dist/evaluator-literals.d.ts +2 -4
- package/dist/evaluator-literals.js +1 -2
- package/dist/evaluator-operations.cjs +2 -3
- package/dist/evaluator-operations.d.cts +4 -6
- package/dist/evaluator-operations.d.ts +4 -6
- package/dist/evaluator-operations.js +2 -3
- package/dist/evaluator-test-helpers.cjs +2 -3
- package/dist/evaluator-test-helpers.d.cts +1 -3
- package/dist/evaluator-test-helpers.d.ts +1 -3
- package/dist/evaluator-test-helpers.js +2 -3
- package/dist/evaluator.cjs +2 -3
- package/dist/evaluator.d.cts +4 -6
- package/dist/evaluator.d.ts +4 -6
- package/dist/evaluator.js +2 -3
- package/dist/functions.cjs +1 -2
- package/dist/functions.d.cts +2 -4
- package/dist/functions.d.ts +2 -4
- package/dist/functions.js +1 -2
- package/dist/{index.CZzC1gGg-C3tq-f5f.cjs → index.CZzC1gGg-CQphWYWn.cjs} +23 -40
- package/dist/{index.CZzC1gGg-DVgiC1Nq.js → index.CZzC1gGg-D3-vRdPe.js} +14 -27
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +10 -10
- package/dist/input-resolvers.cjs +1 -2
- package/dist/input-resolvers.d.cts +2 -4
- package/dist/input-resolvers.d.ts +2 -4
- package/dist/input-resolvers.js +1 -2
- package/dist/integer-power.cjs +1 -2
- package/dist/integer-power.d.cts +1 -3
- package/dist/integer-power.d.ts +1 -3
- package/dist/integer-power.js +1 -2
- package/dist/{json-value-B1Hjjjri.d.cts → json-value-ZLMaKP0n.d.ts} +0 -2
- package/dist/json-value.cjs +1 -2
- package/dist/json-value.d.cts +8 -2
- package/dist/json-value.d.ts +1 -1
- package/dist/json-value.js +1 -2
- package/dist/plain-record.cjs +1 -2
- package/dist/plain-record.d.cts +1 -3
- package/dist/plain-record.d.ts +1 -3
- package/dist/plain-record.js +1 -2
- package/dist/resolvers.d.cts +3 -5
- package/dist/resolvers.d.ts +3 -5
- package/dist/tree.cjs +1 -2
- package/dist/tree.d.cts +2 -4
- package/dist/tree.d.ts +2 -4
- package/dist/tree.js +1 -2
- package/dist-cli/trilean.mjs +24 -47
- package/package.json +4 -4
- package/schemas/trilean.schema.json +1 -1
- package/dist/computed-value-CbRF0Izc.d.ts +0 -51
- package/dist/json-value-B1Hjjjri.d.ts +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_computed_value = require("./computed-value.cjs");
|
|
3
3
|
const require_complex = require("./complex.cjs");
|
|
4
|
-
|
|
4
|
+
// src/builtin-functions.ts
|
|
5
5
|
const DECIMAL_BASE = 10;
|
|
6
6
|
const BINARY_BASE = 2;
|
|
7
7
|
/** Beyond this many decimal places a double either has no digit left to round (positive places) or rounds to zero (negative places): the decimal exponent range of a finite double, from the largest value's order of magnitude down to the smallest subnormal's. Clamping to it keeps the exponent written into a number string well formed whatever count a caller passes. */
|
|
@@ -239,5 +239,4 @@ const builtinFunctions = Object.freeze({
|
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
|
-
//#endregion
|
|
243
242
|
exports.builtinFunctions = builtinFunctions;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FunctionRegistry } from "./functions.cjs";
|
|
2
|
-
//#region src/builtin-functions.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The numeric functions a `call` node can name when an embedder has no registry of its own: `minimum` and `maximum` (one or more numbers in a shared unit), `absoluteValue`, `round` (half away from zero, with an optional count of decimal places), `squareRoot`, `exponential`, `logarithm` (natural, or to an optional real base), the two projections of a complex value onto the reals, `magnitude` and `phase`, and the trigonometric functions `sine`, `cosine`, `tangent`, `arcSine`, `arcCosine`, `arcTangent` and `arcTangent2` (the angle of the point `(x, y)`, called with `y` first).
|
|
5
4
|
*
|
|
@@ -11,5 +10,4 @@ import { FunctionRegistry } from "./functions.cjs";
|
|
|
11
10
|
*
|
|
12
11
|
* Frozen, so mutating the export cannot change what `evaluateDocument` resolves.
|
|
13
12
|
*/
|
|
14
|
-
export declare const builtinFunctions: FunctionRegistry;
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare const builtinFunctions: FunctionRegistry;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FunctionRegistry } from "./functions.js";
|
|
2
|
-
//#region src/builtin-functions.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The numeric functions a `call` node can name when an embedder has no registry of its own: `minimum` and `maximum` (one or more numbers in a shared unit), `absoluteValue`, `round` (half away from zero, with an optional count of decimal places), `squareRoot`, `exponential`, `logarithm` (natural, or to an optional real base), the two projections of a complex value onto the reals, `magnitude` and `phase`, and the trigonometric functions `sine`, `cosine`, `tangent`, `arcSine`, `arcCosine`, `arcTangent` and `arcTangent2` (the angle of the point `(x, y)`, called with `y` first).
|
|
5
4
|
*
|
|
@@ -11,5 +10,4 @@ import { FunctionRegistry } from "./functions.js";
|
|
|
11
10
|
*
|
|
12
11
|
* Frozen, so mutating the export cannot change what `evaluateDocument` resolves.
|
|
13
12
|
*/
|
|
14
|
-
export declare const builtinFunctions: FunctionRegistry;
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare const builtinFunctions: FunctionRegistry;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unitsEqual } from "./computed-value.js";
|
|
2
2
|
import { complexFromPolar, complexMagnitude, complexPhase } from "./complex.js";
|
|
3
|
-
|
|
3
|
+
// src/builtin-functions.ts
|
|
4
4
|
const DECIMAL_BASE = 10;
|
|
5
5
|
const BINARY_BASE = 2;
|
|
6
6
|
/** Beyond this many decimal places a double either has no digit left to round (positive places) or rounds to zero (negative places): the decimal exponent range of a finite double, from the largest value's order of magnitude down to the smallest subnormal's. Clamping to it keeps the exponent written into a number string well formed whatever count a caller passes. */
|
|
@@ -238,5 +238,4 @@ const builtinFunctions = Object.freeze({
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
|
-
//#endregion
|
|
242
241
|
export { builtinFunctions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/complex-division.ts
|
|
3
3
|
/**
|
|
4
4
|
* `value * 2 ** exponent`, applied in two halves because `2 ** exponent` is infinite beyond 1023 and a quotient can need a shift of about twice that. A power of two multiplies a double exactly while the result stays normal, so when the result can be non-zero and finite (a shift between about -1077 and 1024 for a scaled quotient of order one) each half is at most about 540 in magnitude, the first multiplication is exact, and the second rounds only where the result is subnormal. Outside that range the result overflows or is below the smallest subnormal: a non-zero value gives an infinity or zero, which is correct, and a zero value with a shift of 2047 or more gives NaN (zero times an infinite half), which the caller's finite check treats as it does an infinity.
|
|
5
5
|
*/
|
|
@@ -44,5 +44,4 @@ function divideComplexComponents(dividend, divisor) {
|
|
|
44
44
|
im: scaleByPowerOfTwo((b * c - a * d) / denominator, shift)
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
exports.divideComplexComponents = divideComplexComponents;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/complex-division.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The components of `dividend / divisor` for a non-zero divisor.
|
|
4
3
|
*
|
|
@@ -21,5 +20,4 @@ export declare function divideComplexComponents(dividend: Readonly<{
|
|
|
21
20
|
}>): {
|
|
22
21
|
re: number;
|
|
23
22
|
im: number;
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
23
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/complex-division.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The components of `dividend / divisor` for a non-zero divisor.
|
|
4
3
|
*
|
|
@@ -21,5 +20,4 @@ export declare function divideComplexComponents(dividend: Readonly<{
|
|
|
21
20
|
}>): {
|
|
22
21
|
re: number;
|
|
23
22
|
im: number;
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
23
|
+
};
|
package/dist/complex-division.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/complex-division.ts
|
|
2
2
|
/**
|
|
3
3
|
* `value * 2 ** exponent`, applied in two halves because `2 ** exponent` is infinite beyond 1023 and a quotient can need a shift of about twice that. A power of two multiplies a double exactly while the result stays normal, so when the result can be non-zero and finite (a shift between about -1077 and 1024 for a scaled quotient of order one) each half is at most about 540 in magnitude, the first multiplication is exact, and the second rounds only where the result is subnormal. Outside that range the result overflows or is below the smallest subnormal: a non-zero value gives an infinity or zero, which is correct, and a zero value with a shift of 2047 or more gives NaN (zero times an infinite half), which the caller's finite check treats as it does an infinity.
|
|
4
4
|
*/
|
|
@@ -43,5 +43,4 @@ function divideComplexComponents(dividend, divisor) {
|
|
|
43
43
|
im: scaleByPowerOfTwo((b * c - a * d) / denominator, shift)
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
export { divideComplexComponents };
|
package/dist/complex.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/complex.ts
|
|
3
3
|
const complexFromPolar = (magnitude, phase, unit) => ({
|
|
4
4
|
kind: "complex",
|
|
5
5
|
re: magnitude * Math.cos(phase),
|
|
@@ -29,7 +29,6 @@ const complexPhase = (value) => ({
|
|
|
29
29
|
kind: "number",
|
|
30
30
|
value: Math.atan2(value.im + 0, value.re + 0)
|
|
31
31
|
});
|
|
32
|
-
//#endregion
|
|
33
32
|
exports.complexFromPolar = complexFromPolar;
|
|
34
33
|
exports.complexLiteralFromPolar = complexLiteralFromPolar;
|
|
35
34
|
exports.complexMagnitude = complexMagnitude;
|
package/dist/complex.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComputedValue, Unit } from "./computed-value.cjs";
|
|
2
2
|
import { ComplexLiteralNode } from "./tree.cjs";
|
|
3
|
-
//#region src/complex.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The `complex` computed-value kind stores one canonical representation, rectangular (`re` + `im`i), with no `form` discriminant offering a polar alternative alongside it -- see the "Complex values" section of README.md for the reasoning. These four helpers are what keep the magnitude-and-phase view reachable for the domains that reason that way, as conversions at the edges rather than a second encoding of the same value that every operator would then have to branch on.
|
|
6
5
|
*
|
|
@@ -21,5 +20,4 @@ export declare const complexMagnitude: (value: ComplexValue) => NumberValue;
|
|
|
21
20
|
* arg(z), as a dimensionless real number of radians: an angle is a ratio of two lengths, so it carries no unit of its own regardless of what the value it was read from carried. The range is [-pi, pi]: `Math.atan2` returns -pi for a negative real number whose imaginary part is `-0` and +pi when it is `+0`, although the two are the same number and JSON writes both zeros as `0`, and the closed range is what the result can be because a tiny negative imaginary part also rounds to exactly -pi (`phase(-1 - 1e-17i)` is -pi, the true angle being a hair inside). Adding `+0` turns `-0` into `+0` without changing any other value, so a signed zero never gives -pi: a negative real number is +pi whatever the sign of its zero, and zero is 0.
|
|
22
21
|
*/
|
|
23
22
|
export declare const complexPhase: (value: ComplexValue) => NumberValue;
|
|
24
|
-
//#endregion
|
|
25
23
|
export {};
|
package/dist/complex.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as Unit, t as ComputedValue } from "./computed-value-
|
|
1
|
+
import { a as Unit, t as ComputedValue } from "./computed-value-CaFJ1YkU.js";
|
|
2
2
|
import { ComplexLiteralNode } from "./tree.js";
|
|
3
|
-
//#region src/complex.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The `complex` computed-value kind stores one canonical representation, rectangular (`re` + `im`i), with no `form` discriminant offering a polar alternative alongside it -- see the "Complex values" section of README.md for the reasoning. These four helpers are what keep the magnitude-and-phase view reachable for the domains that reason that way, as conversions at the edges rather than a second encoding of the same value that every operator would then have to branch on.
|
|
6
5
|
*
|
|
@@ -21,5 +20,4 @@ export declare const complexMagnitude: (value: ComplexValue) => NumberValue;
|
|
|
21
20
|
* arg(z), as a dimensionless real number of radians: an angle is a ratio of two lengths, so it carries no unit of its own regardless of what the value it was read from carried. The range is [-pi, pi]: `Math.atan2` returns -pi for a negative real number whose imaginary part is `-0` and +pi when it is `+0`, although the two are the same number and JSON writes both zeros as `0`, and the closed range is what the result can be because a tiny negative imaginary part also rounds to exactly -pi (`phase(-1 - 1e-17i)` is -pi, the true angle being a hair inside). Adding `+0` turns `-0` into `+0` without changing any other value, so a signed zero never gives -pi: a negative real number is +pi whatever the sign of its zero, and zero is 0.
|
|
22
21
|
*/
|
|
23
22
|
export declare const complexPhase: (value: ComplexValue) => NumberValue;
|
|
24
|
-
//#endregion
|
|
25
23
|
export {};
|
package/dist/complex.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/complex.ts
|
|
2
2
|
const complexFromPolar = (magnitude, phase, unit) => ({
|
|
3
3
|
kind: "complex",
|
|
4
4
|
re: magnitude * Math.cos(phase),
|
|
@@ -28,5 +28,4 @@ const complexPhase = (value) => ({
|
|
|
28
28
|
kind: "number",
|
|
29
29
|
value: Math.atan2(value.im + 0, value.re + 0)
|
|
30
30
|
});
|
|
31
|
-
//#endregion
|
|
32
31
|
export { complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
//#region src/computed-value.d.ts
|
|
3
2
|
/** Dimension symbol -\> exponent, e.g. `{ m: 1, s: -1 }` for metres per second. A bare symbol like `"kg"` is shorthand for `{ kg: 1 }`. */
|
|
4
3
|
declare const UnitSchema: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
5
4
|
type Unit = z.infer<typeof UnitSchema>;
|
|
@@ -47,5 +46,4 @@ declare function unitsEqual(a: Unit | undefined, b: Unit | undefined): boolean;
|
|
|
47
46
|
declare function combineUnitsForMultiply(a: Unit | undefined, b: Unit | undefined): Unit;
|
|
48
47
|
/** Dividing two unit-tagged numbers subtracts exponents per dimension. An operand with no `unit` is treated as dimensionless (an empty map). */
|
|
49
48
|
declare function combineUnitsForDivide(a: Unit | undefined, b: Unit | undefined): Unit;
|
|
50
|
-
//#endregion
|
|
51
49
|
export { Unit as a, combineUnitsForMultiply as c, DurationUnitSchema as i, unitsEqual as l, ComputedValueSchema as n, UnitSchema as o, DurationUnit as r, combineUnitsForDivide as s, ComputedValue as t };
|
package/dist/computed-value.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let zod = require("zod");
|
|
3
|
-
|
|
3
|
+
// src/computed-value.ts
|
|
4
4
|
/** Dimension symbol -\> exponent, e.g. `{ m: 1, s: -1 }` for metres per second. A bare symbol like `"kg"` is shorthand for `{ kg: 1 }`. */
|
|
5
5
|
const UnitSchema = zod.z.record(zod.z.string(), zod.z.number());
|
|
6
6
|
const DurationUnitSchema = zod.z.enum([
|
|
@@ -72,7 +72,6 @@ function combineUnitsForDivide(a, b) {
|
|
|
72
72
|
for (const [dimension, exponent] of Object.entries(normalizedB)) combined[dimension] = (combined[dimension] ?? 0) - exponent;
|
|
73
73
|
return normalizeUnit(combined);
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
exports.ComputedValueSchema = ComputedValueSchema;
|
|
77
76
|
exports.DurationUnitSchema = DurationUnitSchema;
|
|
78
77
|
exports.UnitSchema = UnitSchema;
|
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Dimension symbol -\> exponent, e.g. `{ m: 1, s: -1 }` for metres per second. A bare symbol like `"kg"` is shorthand for `{ kg: 1 }`. */
|
|
3
|
+
export declare const UnitSchema: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
4
|
+
export type Unit = z.infer<typeof UnitSchema>;
|
|
5
|
+
export declare const DurationUnitSchema: z.ZodEnum<{
|
|
6
|
+
ms: "ms";
|
|
7
|
+
s: "s";
|
|
8
|
+
min: "min";
|
|
9
|
+
h: "h";
|
|
10
|
+
d: "d";
|
|
11
|
+
}>;
|
|
12
|
+
export type DurationUnit = z.infer<typeof DurationUnitSchema>;
|
|
13
|
+
export declare const ComputedValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
kind: z.ZodLiteral<"number">;
|
|
15
|
+
value: z.ZodNumber;
|
|
16
|
+
unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
kind: z.ZodLiteral<"text">;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
kind: z.ZodLiteral<"boolean">;
|
|
22
|
+
value: z.ZodBoolean;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"instant">;
|
|
25
|
+
value: z.ZodString;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"duration">;
|
|
28
|
+
value: z.ZodNumber;
|
|
29
|
+
unit: z.ZodEnum<{
|
|
30
|
+
ms: "ms";
|
|
31
|
+
s: "s";
|
|
32
|
+
min: "min";
|
|
33
|
+
h: "h";
|
|
34
|
+
d: "d";
|
|
35
|
+
}>;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"complex">;
|
|
38
|
+
re: z.ZodNumber;
|
|
39
|
+
im: z.ZodNumber;
|
|
40
|
+
unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
41
|
+
}, z.core.$strip>], "kind">;
|
|
42
|
+
export type ComputedValue = z.infer<typeof ComputedValueSchema>;
|
|
43
|
+
/** An operand with no `unit` is dimensionless (an empty map) for comparison purposes. */
|
|
44
|
+
export declare function unitsEqual(a: Unit | undefined, b: Unit | undefined): boolean;
|
|
45
|
+
/** Multiplying two unit-tagged numbers adds exponents per dimension. An operand with no `unit` is treated as dimensionless (an empty map). */
|
|
46
|
+
export declare function combineUnitsForMultiply(a: Unit | undefined, b: Unit | undefined): Unit;
|
|
47
|
+
/** Dividing two unit-tagged numbers subtracts exponents per dimension. An operand with no `unit` is treated as dimensionless (an empty map). */
|
|
48
|
+
export declare function combineUnitsForDivide(a: Unit | undefined, b: Unit | undefined): Unit;
|
package/dist/computed-value.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Unit, c as combineUnitsForMultiply, i as DurationUnitSchema, l as unitsEqual, n as ComputedValueSchema, o as UnitSchema, r as DurationUnit, s as combineUnitsForDivide, t as ComputedValue } from "./computed-value-
|
|
1
|
+
import { a as Unit, c as combineUnitsForMultiply, i as DurationUnitSchema, l as unitsEqual, n as ComputedValueSchema, o as UnitSchema, r as DurationUnit, s as combineUnitsForDivide, t as ComputedValue } from "./computed-value-CaFJ1YkU.js";
|
|
2
2
|
export { ComputedValue, ComputedValueSchema, DurationUnit, DurationUnitSchema, Unit, UnitSchema, combineUnitsForDivide, combineUnitsForMultiply, unitsEqual };
|
package/dist/computed-value.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
// src/computed-value.ts
|
|
3
3
|
/** Dimension symbol -\> exponent, e.g. `{ m: 1, s: -1 }` for metres per second. A bare symbol like `"kg"` is shorthand for `{ kg: 1 }`. */
|
|
4
4
|
const UnitSchema = z.record(z.string(), z.number());
|
|
5
5
|
const DurationUnitSchema = z.enum([
|
|
@@ -71,5 +71,4 @@ function combineUnitsForDivide(a, b) {
|
|
|
71
71
|
for (const [dimension, exponent] of Object.entries(normalizedB)) combined[dimension] = (combined[dimension] ?? 0) - exponent;
|
|
72
72
|
return normalizeUnit(combined);
|
|
73
73
|
}
|
|
74
|
-
//#endregion
|
|
75
74
|
export { ComputedValueSchema, DurationUnitSchema, UnitSchema, combineUnitsForDivide, combineUnitsForMultiply, unitsEqual };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/derived-aggregates.ts
|
|
3
3
|
/**
|
|
4
4
|
* `sum`, `count`, and `average` are never their own `FoldCombiner` mode -- each is a builder function that assembles an ordinary `fold` (and, for `average`, one `arithmetic` division of two ordinary folds), exactly the same treatment `derived-connectives.ts` already gives `xor`/`nand`/`nor`/`implies`/`iff`/`none` (see the "Derived aggregates" section of README.md).
|
|
5
5
|
*/
|
|
@@ -67,7 +67,6 @@ const average = (collection, item, filter) => ({
|
|
|
67
67
|
left: sum(collection, item, filter),
|
|
68
68
|
right: count(collection, filter)
|
|
69
69
|
});
|
|
70
|
-
//#endregion
|
|
71
70
|
exports.average = average;
|
|
72
71
|
exports.count = count;
|
|
73
72
|
exports.presenceOf = presenceOf;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonValue } from "./json-value.cjs";
|
|
2
2
|
import { ExpressionNode, PredicateNode } from "./tree.cjs";
|
|
3
|
-
//#region src/derived-aggregates.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `sum`, `count`, and `average` are never their own `FoldCombiner` mode -- each is a builder function that assembles an ordinary `fold` (and, for `average`, one `arithmetic` division of two ordinary folds), exactly the same treatment `derived-connectives.ts` already gives `xor`/`nand`/`nor`/`implies`/`iff`/`none` (see the "Derived aggregates" section of README.md).
|
|
6
5
|
*/
|
|
7
6
|
export declare const sum: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
|
|
8
7
|
export declare const presenceOf: (probe: ExpressionNode) => ExpressionNode;
|
|
9
8
|
export declare const count: (collection: JsonValue, filter?: PredicateNode, probe?: ExpressionNode) => ExpressionNode;
|
|
10
|
-
export declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { t as JsonValue } from "./json-value-
|
|
1
|
+
import { t as JsonValue } from "./json-value-ZLMaKP0n.js";
|
|
2
2
|
import { ExpressionNode, PredicateNode } from "./tree.js";
|
|
3
|
-
//#region src/derived-aggregates.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `sum`, `count`, and `average` are never their own `FoldCombiner` mode -- each is a builder function that assembles an ordinary `fold` (and, for `average`, one `arithmetic` division of two ordinary folds), exactly the same treatment `derived-connectives.ts` already gives `xor`/`nand`/`nor`/`implies`/`iff`/`none` (see the "Derived aggregates" section of README.md).
|
|
6
5
|
*/
|
|
7
6
|
export declare const sum: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
|
|
8
7
|
export declare const presenceOf: (probe: ExpressionNode) => ExpressionNode;
|
|
9
8
|
export declare const count: (collection: JsonValue, filter?: PredicateNode, probe?: ExpressionNode) => ExpressionNode;
|
|
10
|
-
export declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/derived-aggregates.ts
|
|
2
2
|
/**
|
|
3
3
|
* `sum`, `count`, and `average` are never their own `FoldCombiner` mode -- each is a builder function that assembles an ordinary `fold` (and, for `average`, one `arithmetic` division of two ordinary folds), exactly the same treatment `derived-connectives.ts` already gives `xor`/`nand`/`nor`/`implies`/`iff`/`none` (see the "Derived aggregates" section of README.md).
|
|
4
4
|
*/
|
|
@@ -66,5 +66,4 @@ const average = (collection, item, filter) => ({
|
|
|
66
66
|
left: sum(collection, item, filter),
|
|
67
67
|
right: count(collection, filter)
|
|
68
68
|
});
|
|
69
|
-
//#endregion
|
|
70
69
|
export { average, count, presenceOf, sum };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/derived-connectives.ts
|
|
3
3
|
/**
|
|
4
4
|
* `not`/`and`/`or` are the primitive `PredicateNode` object-constructors -- everything else in this file is built purely by composing these three, so its three-valued correctness is inherited from the already-verified AND/OR/NOT tables rather than requiring a separate proof (see the "Derived connectives" section of README.md).
|
|
5
5
|
*/
|
|
@@ -28,7 +28,6 @@ const none = (collection, item, filter) => not({
|
|
|
28
28
|
item,
|
|
29
29
|
filter
|
|
30
30
|
});
|
|
31
|
-
//#endregion
|
|
32
31
|
exports.and = and;
|
|
33
32
|
exports.iff = iff;
|
|
34
33
|
exports.implies = implies;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonValue } from "./json-value.cjs";
|
|
2
2
|
import { PredicateNode } from "./tree.cjs";
|
|
3
|
-
//#region src/derived-connectives.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `not`/`and`/`or` are the primitive `PredicateNode` object-constructors -- everything else in this file is built purely by composing these three, so its three-valued correctness is inherited from the already-verified AND/OR/NOT tables rather than requiring a separate proof (see the "Derived connectives" section of README.md).
|
|
6
5
|
*/
|
|
@@ -12,5 +11,4 @@ export declare const nand: (a: PredicateNode, b: PredicateNode) => PredicateNode
|
|
|
12
11
|
export declare const nor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
|
|
13
12
|
export declare const implies: (a: PredicateNode, b: PredicateNode) => PredicateNode;
|
|
14
13
|
export declare const iff: (a: PredicateNode, b: PredicateNode) => PredicateNode;
|
|
15
|
-
export declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
|
|
16
|
-
//#endregion
|
|
14
|
+
export declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as JsonValue } from "./json-value-
|
|
1
|
+
import { t as JsonValue } from "./json-value-ZLMaKP0n.js";
|
|
2
2
|
import { PredicateNode } from "./tree.js";
|
|
3
|
-
//#region src/derived-connectives.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `not`/`and`/`or` are the primitive `PredicateNode` object-constructors -- everything else in this file is built purely by composing these three, so its three-valued correctness is inherited from the already-verified AND/OR/NOT tables rather than requiring a separate proof (see the "Derived connectives" section of README.md).
|
|
6
5
|
*/
|
|
@@ -12,5 +11,4 @@ export declare const nand: (a: PredicateNode, b: PredicateNode) => PredicateNode
|
|
|
12
11
|
export declare const nor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
|
|
13
12
|
export declare const implies: (a: PredicateNode, b: PredicateNode) => PredicateNode;
|
|
14
13
|
export declare const iff: (a: PredicateNode, b: PredicateNode) => PredicateNode;
|
|
15
|
-
export declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
|
|
16
|
-
//#endregion
|
|
14
|
+
export declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/derived-connectives.ts
|
|
2
2
|
/**
|
|
3
3
|
* `not`/`and`/`or` are the primitive `PredicateNode` object-constructors -- everything else in this file is built purely by composing these three, so its three-valued correctness is inherited from the already-verified AND/OR/NOT tables rather than requiring a separate proof (see the "Derived connectives" section of README.md).
|
|
4
4
|
*/
|
|
@@ -27,5 +27,4 @@ const none = (collection, item, filter) => not({
|
|
|
27
27
|
item,
|
|
28
28
|
filter
|
|
29
29
|
});
|
|
30
|
-
//#endregion
|
|
31
30
|
export { and, iff, implies, nand, none, nor, not, or, xor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/derived-patterns.ts
|
|
3
3
|
/**
|
|
4
4
|
* `prefixPattern`/`wildcardPattern`/`hierarchicalGlobPattern` are never their own node kind and add no evaluator branch -- each is a builder function that compiles its pattern string into a portable regular-expression string and assembles an ordinary `textCompare` node with `op: "matches"` around it, exactly the same treatment `derived-connectives.ts`/`derived-aggregates.ts`/`derived-values.ts` already give `xor`/`sum`/`coalesce` (see the "Pattern-matching builders" section of README.md). The compilation happens once, when the tree is built, so what is stored and evaluated is an ordinary `textCompare` tree indistinguishable from one written out by hand.
|
|
5
5
|
*/
|
|
@@ -88,7 +88,6 @@ const matchesCompiledPattern = (text, compiled) => ({
|
|
|
88
88
|
const prefixPattern = (text, prefix) => matchesCompiledPattern(text, compilePrefixPattern(prefix));
|
|
89
89
|
const wildcardPattern = (text, pattern) => matchesCompiledPattern(text, compileWildcardPattern(pattern));
|
|
90
90
|
const hierarchicalGlobPattern = (text, pattern) => matchesCompiledPattern(text, compileHierarchicalGlobPattern(pattern));
|
|
91
|
-
//#endregion
|
|
92
91
|
exports.hierarchicalGlobPattern = hierarchicalGlobPattern;
|
|
93
92
|
exports.prefixPattern = prefixPattern;
|
|
94
93
|
exports.wildcardPattern = wildcardPattern;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ExpressionNode, PredicateNode } from "./tree.cjs";
|
|
2
|
-
//#region src/derived-patterns.d.ts
|
|
3
2
|
export declare const prefixPattern: (text: ExpressionNode, prefix: string) => PredicateNode;
|
|
4
3
|
export declare const wildcardPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
|
|
5
|
-
export declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ExpressionNode, PredicateNode } from "./tree.js";
|
|
2
|
-
//#region src/derived-patterns.d.ts
|
|
3
2
|
export declare const prefixPattern: (text: ExpressionNode, prefix: string) => PredicateNode;
|
|
4
3
|
export declare const wildcardPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
|
|
5
|
-
export declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
|
package/dist/derived-patterns.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/derived-patterns.ts
|
|
2
2
|
/**
|
|
3
3
|
* `prefixPattern`/`wildcardPattern`/`hierarchicalGlobPattern` are never their own node kind and add no evaluator branch -- each is a builder function that compiles its pattern string into a portable regular-expression string and assembles an ordinary `textCompare` node with `op: "matches"` around it, exactly the same treatment `derived-connectives.ts`/`derived-aggregates.ts`/`derived-values.ts` already give `xor`/`sum`/`coalesce` (see the "Pattern-matching builders" section of README.md). The compilation happens once, when the tree is built, so what is stored and evaluated is an ordinary `textCompare` tree indistinguishable from one written out by hand.
|
|
4
4
|
*/
|
|
@@ -87,5 +87,4 @@ const matchesCompiledPattern = (text, compiled) => ({
|
|
|
87
87
|
const prefixPattern = (text, prefix) => matchesCompiledPattern(text, compilePrefixPattern(prefix));
|
|
88
88
|
const wildcardPattern = (text, pattern) => matchesCompiledPattern(text, compileWildcardPattern(pattern));
|
|
89
89
|
const hierarchicalGlobPattern = (text, pattern) => matchesCompiledPattern(text, compileHierarchicalGlobPattern(pattern));
|
|
90
|
-
//#endregion
|
|
91
90
|
export { hierarchicalGlobPattern, prefixPattern, wildcardPattern };
|
package/dist/derived-values.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/derived-values.ts
|
|
3
3
|
/**
|
|
4
4
|
* `coalesce` is never its own evaluated node kind -- it assembles an ordinary `conditional` whose single case's `when` is an `exists` probe of the current candidate, the same "derived = composition, not new logic" treatment derived-connectives.ts and derived-aggregates.ts already give `xor`/`sum`/`average` (see the "Derived values" section of README.md). Falling through to the next candidate happens only on `exists`'s own `false` -- a genuinely absent value (`not-found`) -- never on a candidate that resolved to something unusable (`wrong-type`/`domain-error`): `exists` already draws exactly that line (see the `exists` section of README.md), and `coalesce` inherits it unmodified rather than re-deciding it. A candidate that is `not-yet-known` (a resolver reported it as not yet supplied) is not a known absence, so `exists` is indeterminate on it and the whole `coalesce` stays indeterminate: falling through would answer with a later candidate that the earlier one's arrival could displace.
|
|
5
5
|
*
|
|
@@ -20,5 +20,4 @@ const coalesce = (first, second, ...rest) => [
|
|
|
20
20
|
}],
|
|
21
21
|
fallback
|
|
22
22
|
}));
|
|
23
|
-
//#endregion
|
|
24
23
|
exports.coalesce = coalesce;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ExpressionNode } from "./tree.cjs";
|
|
2
|
-
//#region src/derived-values.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* `coalesce` is never its own evaluated node kind -- it assembles an ordinary `conditional` whose single case's `when` is an `exists` probe of the current candidate, the same "derived = composition, not new logic" treatment derived-connectives.ts and derived-aggregates.ts already give `xor`/`sum`/`average` (see the "Derived values" section of README.md). Falling through to the next candidate happens only on `exists`'s own `false` -- a genuinely absent value (`not-found`) -- never on a candidate that resolved to something unusable (`wrong-type`/`domain-error`): `exists` already draws exactly that line (see the `exists` section of README.md), and `coalesce` inherits it unmodified rather than re-deciding it. A candidate that is `not-yet-known` (a resolver reported it as not yet supplied) is not a known absence, so `exists` is indeterminate on it and the whole `coalesce` stays indeterminate: falling through would answer with a later candidate that the earlier one's arrival could displace.
|
|
5
4
|
*
|
|
6
5
|
* Built right-to-left over the full `[first, second, ...rest]` candidate list via `reduceRight`, which needs no seed value here -- `first`/`second` being required arguments (rather than accepting a single `ExpressionNode[]`) guarantees the list always has at least two elements, so the no-initial-value overload of `reduceRight` never hits an empty array.
|
|
7
6
|
*/
|
|
8
|
-
export declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
|
package/dist/derived-values.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ExpressionNode } from "./tree.js";
|
|
2
|
-
//#region src/derived-values.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* `coalesce` is never its own evaluated node kind -- it assembles an ordinary `conditional` whose single case's `when` is an `exists` probe of the current candidate, the same "derived = composition, not new logic" treatment derived-connectives.ts and derived-aggregates.ts already give `xor`/`sum`/`average` (see the "Derived values" section of README.md). Falling through to the next candidate happens only on `exists`'s own `false` -- a genuinely absent value (`not-found`) -- never on a candidate that resolved to something unusable (`wrong-type`/`domain-error`): `exists` already draws exactly that line (see the `exists` section of README.md), and `coalesce` inherits it unmodified rather than re-deciding it. A candidate that is `not-yet-known` (a resolver reported it as not yet supplied) is not a known absence, so `exists` is indeterminate on it and the whole `coalesce` stays indeterminate: falling through would answer with a later candidate that the earlier one's arrival could displace.
|
|
5
4
|
*
|
|
6
5
|
* Built right-to-left over the full `[first, second, ...rest]` candidate list via `reduceRight`, which needs no seed value here -- `first`/`second` being required arguments (rather than accepting a single `ExpressionNode[]`) guarantees the list always has at least two elements, so the no-initial-value overload of `reduceRight` never hits an empty array.
|
|
7
6
|
*/
|
|
8
|
-
export declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
|
package/dist/derived-values.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/derived-values.ts
|
|
2
2
|
/**
|
|
3
3
|
* `coalesce` is never its own evaluated node kind -- it assembles an ordinary `conditional` whose single case's `when` is an `exists` probe of the current candidate, the same "derived = composition, not new logic" treatment derived-connectives.ts and derived-aggregates.ts already give `xor`/`sum`/`average` (see the "Derived values" section of README.md). Falling through to the next candidate happens only on `exists`'s own `false` -- a genuinely absent value (`not-found`) -- never on a candidate that resolved to something unusable (`wrong-type`/`domain-error`): `exists` already draws exactly that line (see the `exists` section of README.md), and `coalesce` inherits it unmodified rather than re-deciding it. A candidate that is `not-yet-known` (a resolver reported it as not yet supplied) is not a known absence, so `exists` is indeterminate on it and the whole `coalesce` stays indeterminate: falling through would answer with a later candidate that the earlier one's arrival could displace.
|
|
4
4
|
*
|
|
@@ -19,5 +19,4 @@ const coalesce = (first, second, ...rest) => [
|
|
|
19
19
|
}],
|
|
20
20
|
fallback
|
|
21
21
|
}));
|
|
22
|
-
//#endregion
|
|
23
22
|
export { coalesce };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
2
2
|
var comma = ",".charCodeAt(0);
|
|
3
3
|
var semicolon = ";".charCodeAt(0);
|
|
4
4
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
@@ -92,8 +92,7 @@ function encode(decoded) {
|
|
|
92
92
|
}
|
|
93
93
|
return writer.flush();
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
//#region ../../node_modules/.pnpm/magic-string@1.4.5/node_modules/magic-string/dist/index.mjs
|
|
95
|
+
// ../../node_modules/.pnpm/magic-string@1.4.5/node_modules/magic-string/dist/index.mjs
|
|
97
96
|
var BitSet = class BitSet {
|
|
98
97
|
constructor(arg) {
|
|
99
98
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -1610,5 +1609,4 @@ var MagicString = class MagicString {
|
|
|
1610
1609
|
return this._replaceRegexp(searchValue, replacement);
|
|
1611
1610
|
}
|
|
1612
1611
|
};
|
|
1613
|
-
//#endregion
|
|
1614
1612
|
export { MagicString, MagicString as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
2
2
|
var comma = ",".charCodeAt(0);
|
|
3
3
|
var semicolon = ";".charCodeAt(0);
|
|
4
4
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
@@ -92,8 +92,7 @@ function encode(decoded) {
|
|
|
92
92
|
}
|
|
93
93
|
return writer.flush();
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
//#region ../../node_modules/.pnpm/magic-string@1.4.5/node_modules/magic-string/dist/index.mjs
|
|
95
|
+
// ../../node_modules/.pnpm/magic-string@1.4.5/node_modules/magic-string/dist/index.mjs
|
|
97
96
|
var BitSet = class BitSet {
|
|
98
97
|
constructor(arg) {
|
|
99
98
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -1610,5 +1609,4 @@ var MagicString = class MagicString {
|
|
|
1610
1609
|
return this._replaceRegexp(searchValue, replacement);
|
|
1611
1610
|
}
|
|
1612
1611
|
};
|
|
1613
|
-
//#endregion
|
|
1614
1612
|
exports.default = MagicString;
|
package/dist/duration-order.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/duration-order.ts
|
|
3
3
|
/** How many milliseconds one of each duration unit is. Every unit is a whole multiple of every finer one, which is what lets a value be divided down into a coarser unit by an exact integer. */
|
|
4
4
|
const millisecondsPerDurationUnit = {
|
|
5
5
|
ms: 1,
|
|
@@ -79,6 +79,5 @@ function compareDurations(left, right) {
|
|
|
79
79
|
size: rightSize
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
exports.compareDurations = compareDurations;
|
|
84
83
|
exports.millisecondsPerDurationUnit = millisecondsPerDurationUnit;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/duration-order.d.ts
|
|
1
|
+
import { DurationUnit } from "./computed-value.cjs";
|
|
3
2
|
/** How many milliseconds one of each duration unit is. Every unit is a whole multiple of every finer one, which is what lets a value be divided down into a coarser unit by an exact integer. */
|
|
4
3
|
export declare const millisecondsPerDurationUnit: Record<DurationUnit, number>;
|
|
5
4
|
type Ordering = -1 | 0 | 1;
|
|
@@ -19,5 +18,4 @@ export declare function compareDurations(left: Readonly<{
|
|
|
19
18
|
value: number;
|
|
20
19
|
unit: DurationUnit;
|
|
21
20
|
}>): Ordering | undefined;
|
|
22
|
-
//#endregion
|
|
23
21
|
export {};
|
package/dist/duration-order.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { r as DurationUnit } from "./computed-value-
|
|
2
|
-
//#region src/duration-order.d.ts
|
|
1
|
+
import { r as DurationUnit } from "./computed-value-CaFJ1YkU.js";
|
|
3
2
|
/** How many milliseconds one of each duration unit is. Every unit is a whole multiple of every finer one, which is what lets a value be divided down into a coarser unit by an exact integer. */
|
|
4
3
|
export declare const millisecondsPerDurationUnit: Record<DurationUnit, number>;
|
|
5
4
|
type Ordering = -1 | 0 | 1;
|
|
@@ -19,5 +18,4 @@ export declare function compareDurations(left: Readonly<{
|
|
|
19
18
|
value: number;
|
|
20
19
|
unit: DurationUnit;
|
|
21
20
|
}>): Ordering | undefined;
|
|
22
|
-
//#endregion
|
|
23
21
|
export {};
|
package/dist/duration-order.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/duration-order.ts
|
|
2
2
|
/** How many milliseconds one of each duration unit is. Every unit is a whole multiple of every finer one, which is what lets a value be divided down into a coarser unit by an exact integer. */
|
|
3
3
|
const millisecondsPerDurationUnit = {
|
|
4
4
|
ms: 1,
|
|
@@ -78,5 +78,4 @@ function compareDurations(left, right) {
|
|
|
78
78
|
size: rightSize
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
//#endregion
|
|
82
81
|
export { compareDurations, millisecondsPerDurationUnit };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_computed_value = require("./computed-value.cjs");
|
|
3
|
-
const require_builtin_functions = require("./builtin-functions.cjs");
|
|
4
|
-
const require_tree = require("./tree.cjs");
|
|
5
3
|
const require_evaluator_factory = require("./evaluator-factory.cjs");
|
|
6
|
-
const
|
|
4
|
+
const require_builtin_functions = require("./builtin-functions.cjs");
|
|
7
5
|
const require_input_resolvers = require("./input-resolvers.cjs");
|
|
8
|
-
|
|
6
|
+
const require_plain_record = require("./plain-record.cjs");
|
|
7
|
+
const require_tree = require("./tree.cjs");
|
|
8
|
+
// src/evaluate-document.ts
|
|
9
9
|
const predicateKinds = new Set(require_tree.PredicateNodeSchema.options.map((option) => option.shape.kind.value));
|
|
10
10
|
/** What a definite expression result that `ComputedValueSchema` refuses is reported as: the only way a result fails it is a non-finite number, which JSON would write as `null`. The evaluator's arithmetic and the built-in functions already keep one from forming, so this is the last check before a value leaves the document boundary, and it fails loudly rather than print a different value from the one computed. */
|
|
11
11
|
const NOT_REPRESENTABLE = "(result): the value is not a finite number";
|
|
@@ -89,5 +89,4 @@ function evaluateDocument({ tree, inputs, as, maxNodes }) {
|
|
|
89
89
|
evaluation
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
exports.evaluateDocument = evaluateDocument;
|