@elaraai/east 0.0.1-beta.3 → 0.0.1-beta.31
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/LICENSE.md +15 -666
- package/README.md +30 -8
- package/dist/src/analyze.d.ts +3 -0
- package/dist/src/analyze.d.ts.map +1 -1
- package/dist/src/analyze.js +76 -15
- package/dist/src/analyze.js.map +1 -1
- package/dist/src/ast.d.ts +37 -33
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast_to_ir.d.ts +6 -0
- package/dist/src/ast_to_ir.d.ts.map +1 -1
- package/dist/src/ast_to_ir.js +135 -101
- package/dist/src/ast_to_ir.js.map +1 -1
- package/dist/src/builtins.d.ts +1 -1
- package/dist/src/builtins.d.ts.map +1 -1
- package/dist/src/builtins.js +32 -0
- package/dist/src/builtins.js.map +1 -1
- package/dist/src/comparison.d.ts.map +1 -1
- package/dist/src/comparison.js +12 -4
- package/dist/src/comparison.js.map +1 -1
- package/dist/src/compile.d.ts +26 -1
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +388 -257
- package/dist/src/compile.js.map +1 -1
- package/dist/src/datetime_format/types.d.ts +23 -23
- package/dist/src/eastir.d.ts +4 -0
- package/dist/src/eastir.d.ts.map +1 -1
- package/dist/src/eastir.js +27 -7
- package/dist/src/eastir.js.map +1 -1
- package/dist/src/error.d.ts +12 -1
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +31 -1
- package/dist/src/error.js.map +1 -1
- package/dist/src/expr/array.d.ts +109 -1
- package/dist/src/expr/array.d.ts.map +1 -1
- package/dist/src/expr/array.js +204 -44
- package/dist/src/expr/array.js.map +1 -1
- package/dist/src/expr/ast.d.ts +1 -1
- package/dist/src/expr/ast.d.ts.map +1 -1
- package/dist/src/expr/ast.js +16 -28
- package/dist/src/expr/ast.js.map +1 -1
- package/dist/src/expr/asyncfunction.js +1 -1
- package/dist/src/expr/asyncfunction.js.map +1 -1
- package/dist/src/expr/blob.d.ts +73 -1
- package/dist/src/expr/blob.d.ts.map +1 -1
- package/dist/src/expr/blob.js +97 -7
- package/dist/src/expr/blob.js.map +1 -1
- package/dist/src/expr/block.d.ts +232 -12
- package/dist/src/expr/block.d.ts.map +1 -1
- package/dist/src/expr/block.js +646 -140
- package/dist/src/expr/block.js.map +1 -1
- package/dist/src/expr/boolean.d.ts +44 -0
- package/dist/src/expr/boolean.d.ts.map +1 -1
- package/dist/src/expr/boolean.js +57 -5
- package/dist/src/expr/boolean.js.map +1 -1
- package/dist/src/expr/datetime.d.ts +135 -0
- package/dist/src/expr/datetime.d.ts.map +1 -1
- package/dist/src/expr/datetime.js +183 -33
- package/dist/src/expr/datetime.js.map +1 -1
- package/dist/src/expr/dict.d.ts +42 -0
- package/dist/src/expr/dict.d.ts.map +1 -1
- package/dist/src/expr/dict.js +105 -55
- package/dist/src/expr/dict.js.map +1 -1
- package/dist/src/expr/expr.d.ts +1 -1
- package/dist/src/expr/expr.d.ts.map +1 -1
- package/dist/src/expr/expr.js.map +1 -1
- package/dist/src/expr/float.d.ts +153 -0
- package/dist/src/expr/float.d.ts.map +1 -1
- package/dist/src/expr/float.js +190 -16
- package/dist/src/expr/float.js.map +1 -1
- package/dist/src/expr/function.d.ts +7 -2
- package/dist/src/expr/function.d.ts.map +1 -1
- package/dist/src/expr/function.js +1 -1
- package/dist/src/expr/function.js.map +1 -1
- package/dist/src/expr/index.d.ts +202 -2
- package/dist/src/expr/index.d.ts.map +1 -1
- package/dist/src/expr/index.js +207 -2
- package/dist/src/expr/index.js.map +1 -1
- package/dist/src/expr/integer.d.ts +180 -0
- package/dist/src/expr/integer.d.ts.map +1 -1
- package/dist/src/expr/integer.js +188 -17
- package/dist/src/expr/integer.js.map +1 -1
- package/dist/src/expr/libs/blob.js +2 -2
- package/dist/src/expr/libs/blob.js.map +1 -1
- package/dist/src/expr/libs/integer.d.ts +19 -0
- package/dist/src/expr/libs/integer.d.ts.map +1 -1
- package/dist/src/expr/libs/integer.js +47 -0
- package/dist/src/expr/libs/integer.js.map +1 -1
- package/dist/src/expr/libs/string.js +1 -1
- package/dist/src/expr/libs/string.js.map +1 -1
- package/dist/src/expr/recursive.d.ts +83 -0
- package/dist/src/expr/recursive.d.ts.map +1 -0
- package/dist/src/expr/recursive.js +99 -0
- package/dist/src/expr/recursive.js.map +1 -0
- package/dist/src/expr/ref.js +3 -3
- package/dist/src/expr/ref.js.map +1 -1
- package/dist/src/expr/set.d.ts +44 -2
- package/dist/src/expr/set.d.ts.map +1 -1
- package/dist/src/expr/set.js +97 -47
- package/dist/src/expr/set.js.map +1 -1
- package/dist/src/expr/string.d.ts +134 -0
- package/dist/src/expr/string.d.ts.map +1 -1
- package/dist/src/expr/string.js +172 -22
- package/dist/src/expr/string.js.map +1 -1
- package/dist/src/expr/struct.d.ts +1 -1
- package/dist/src/expr/struct.d.ts.map +1 -1
- package/dist/src/expr/struct.js +1 -1
- package/dist/src/expr/struct.js.map +1 -1
- package/dist/src/expr/types.d.ts +7 -6
- package/dist/src/expr/types.d.ts.map +1 -1
- package/dist/src/expr/variant.d.ts +123 -1
- package/dist/src/expr/variant.d.ts.map +1 -1
- package/dist/src/expr/variant.js +66 -2
- package/dist/src/expr/variant.js.map +1 -1
- package/dist/src/fuzz.d.ts +36 -2
- package/dist/src/fuzz.d.ts.map +1 -1
- package/dist/src/fuzz.js +344 -77
- package/dist/src/fuzz.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +12 -0
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +13 -0
- package/dist/src/internal.js.map +1 -1
- package/dist/src/ir.d.ts +1551 -1505
- package/dist/src/ir.d.ts.map +1 -1
- package/dist/src/ir.js +49 -34
- package/dist/src/ir.js.map +1 -1
- package/dist/src/location.d.ts +30 -10
- package/dist/src/location.d.ts.map +1 -1
- package/dist/src/location.js +70 -28
- package/dist/src/location.js.map +1 -1
- package/dist/src/patch/apply.d.ts +15 -0
- package/dist/src/patch/apply.d.ts.map +1 -0
- package/dist/src/patch/apply.js +380 -0
- package/dist/src/patch/apply.js.map +1 -0
- package/dist/src/patch/compose.d.ts +15 -0
- package/dist/src/patch/compose.d.ts.map +1 -0
- package/dist/src/patch/compose.js +480 -0
- package/dist/src/patch/compose.js.map +1 -0
- package/dist/src/patch/diff.d.ts +15 -0
- package/dist/src/patch/diff.d.ts.map +1 -0
- package/dist/src/patch/diff.js +328 -0
- package/dist/src/patch/diff.js.map +1 -0
- package/dist/src/patch/fuzz.d.ts +73 -0
- package/dist/src/patch/fuzz.d.ts.map +1 -0
- package/dist/src/patch/fuzz.js +159 -0
- package/dist/src/patch/fuzz.js.map +1 -0
- package/dist/src/patch/index.d.ts +18 -0
- package/dist/src/patch/index.d.ts.map +1 -0
- package/dist/src/patch/index.js +20 -0
- package/dist/src/patch/index.js.map +1 -0
- package/dist/src/patch/invert.d.ts +15 -0
- package/dist/src/patch/invert.d.ts.map +1 -0
- package/dist/src/patch/invert.js +302 -0
- package/dist/src/patch/invert.js.map +1 -0
- package/dist/src/patch/type_of_patch.d.ts +17 -0
- package/dist/src/patch/type_of_patch.d.ts.map +1 -0
- package/dist/src/patch/type_of_patch.js +143 -0
- package/dist/src/patch/type_of_patch.js.map +1 -0
- package/dist/src/patch/types.d.ts +166 -0
- package/dist/src/patch/types.d.ts.map +1 -0
- package/dist/src/patch/types.js +69 -0
- package/dist/src/patch/types.js.map +1 -0
- package/dist/src/platform.d.ts +6 -0
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/serialization/beast.d.ts.map +1 -1
- package/dist/src/serialization/beast.js +53 -18
- package/dist/src/serialization/beast.js.map +1 -1
- package/dist/src/serialization/beast2.d.ts +39 -3
- package/dist/src/serialization/beast2.d.ts.map +1 -1
- package/dist/src/serialization/beast2.js +241 -18
- package/dist/src/serialization/beast2.js.map +1 -1
- package/dist/src/serialization/csv.d.ts +139 -0
- package/dist/src/serialization/csv.d.ts.map +1 -0
- package/dist/src/serialization/csv.js +615 -0
- package/dist/src/serialization/csv.js.map +1 -0
- package/dist/src/serialization/index.d.ts +2 -1
- package/dist/src/serialization/index.d.ts.map +1 -1
- package/dist/src/serialization/index.js +2 -1
- package/dist/src/serialization/index.js.map +1 -1
- package/dist/src/type_of_type.d.ts +45 -34
- package/dist/src/type_of_type.d.ts.map +1 -1
- package/dist/src/type_of_type.js +62 -1
- package/dist/src/type_of_type.js.map +1 -1
- package/dist/src/types.d.ts +8 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +4 -4
- package/dist/src/types.js.map +1 -1
- package/package.json +4 -5
|
@@ -44,51 +44,51 @@ export declare const DateTimeFormatTokenType: VariantType<{
|
|
|
44
44
|
* Any characters in the format string that are not recognized as format
|
|
45
45
|
* codes are treated as literals.
|
|
46
46
|
*/
|
|
47
|
-
literal: StringType;
|
|
47
|
+
readonly literal: StringType;
|
|
48
48
|
/** Four-digit year (e.g., "2025") - Format: YYYY */
|
|
49
|
-
year4: NullType;
|
|
49
|
+
readonly year4: NullType;
|
|
50
50
|
/** Two-digit year (e.g., "25") - Format: YY */
|
|
51
|
-
year2: NullType;
|
|
51
|
+
readonly year2: NullType;
|
|
52
52
|
/** Month as 1-12 without zero-padding (e.g., "1", "12") - Format: M */
|
|
53
|
-
month1: NullType;
|
|
53
|
+
readonly month1: NullType;
|
|
54
54
|
/** Month as 01-12 with zero-padding (e.g., "01", "12") - Format: MM */
|
|
55
|
-
month2: NullType;
|
|
55
|
+
readonly month2: NullType;
|
|
56
56
|
/** Short month name (e.g., "Jan", "Feb") - Format: MMM */
|
|
57
|
-
monthNameShort: NullType;
|
|
57
|
+
readonly monthNameShort: NullType;
|
|
58
58
|
/** Full month name (e.g., "January", "February") - Format: MMMM */
|
|
59
|
-
monthNameFull: NullType;
|
|
59
|
+
readonly monthNameFull: NullType;
|
|
60
60
|
/** Day of month as 1-31 without zero-padding (e.g., "1", "31") - Format: D */
|
|
61
|
-
day1: NullType;
|
|
61
|
+
readonly day1: NullType;
|
|
62
62
|
/** Day of month as 01-31 with zero-padding (e.g., "01", "31") - Format: DD */
|
|
63
|
-
day2: NullType;
|
|
63
|
+
readonly day2: NullType;
|
|
64
64
|
/** Minimal weekday name (e.g., "Su", "Mo") - Format: dd */
|
|
65
|
-
weekdayNameMin: NullType;
|
|
65
|
+
readonly weekdayNameMin: NullType;
|
|
66
66
|
/** Short weekday name (e.g., "Sun", "Mon") - Format: ddd */
|
|
67
|
-
weekdayNameShort: NullType;
|
|
67
|
+
readonly weekdayNameShort: NullType;
|
|
68
68
|
/** Full weekday name (e.g., "Sunday", "Monday") - Format: dddd */
|
|
69
|
-
weekdayNameFull: NullType;
|
|
69
|
+
readonly weekdayNameFull: NullType;
|
|
70
70
|
/** Hour 0-23 without zero-padding (e.g., "0", "23") - Format: H */
|
|
71
|
-
hour24_1: NullType;
|
|
71
|
+
readonly hour24_1: NullType;
|
|
72
72
|
/** Hour 00-23 with zero-padding (e.g., "00", "23") - Format: HH */
|
|
73
|
-
hour24_2: NullType;
|
|
73
|
+
readonly hour24_2: NullType;
|
|
74
74
|
/** Hour 1-12 without zero-padding (e.g., "1", "12") - Format: h */
|
|
75
|
-
hour12_1: NullType;
|
|
75
|
+
readonly hour12_1: NullType;
|
|
76
76
|
/** Hour 01-12 with zero-padding (e.g., "01", "12") - Format: hh */
|
|
77
|
-
hour12_2: NullType;
|
|
77
|
+
readonly hour12_2: NullType;
|
|
78
78
|
/** Minute 0-59 without zero-padding (e.g., "0", "59") - Format: m */
|
|
79
|
-
minute1: NullType;
|
|
79
|
+
readonly minute1: NullType;
|
|
80
80
|
/** Minute 00-59 with zero-padding (e.g., "00", "59") - Format: mm */
|
|
81
|
-
minute2: NullType;
|
|
81
|
+
readonly minute2: NullType;
|
|
82
82
|
/** Second 0-59 without zero-padding (e.g., "0", "59") - Format: s */
|
|
83
|
-
second1: NullType;
|
|
83
|
+
readonly second1: NullType;
|
|
84
84
|
/** Second 00-59 with zero-padding (e.g., "00", "59") - Format: ss */
|
|
85
|
-
second2: NullType;
|
|
85
|
+
readonly second2: NullType;
|
|
86
86
|
/** Millisecond 000-999 with zero-padding (e.g., "000", "999") - Format: SSS */
|
|
87
|
-
millisecond3: NullType;
|
|
87
|
+
readonly millisecond3: NullType;
|
|
88
88
|
/** Uppercase AM/PM (e.g., "AM", "PM") - Format: A */
|
|
89
|
-
ampmUpper: NullType;
|
|
89
|
+
readonly ampmUpper: NullType;
|
|
90
90
|
/** Lowercase am/pm (e.g., "am", "pm") - Format: a */
|
|
91
|
-
ampmLower: NullType;
|
|
91
|
+
readonly ampmLower: NullType;
|
|
92
92
|
}>;
|
|
93
93
|
/**
|
|
94
94
|
* TypeScript type for datetime format tokens.
|
package/dist/src/eastir.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare class EastIR<Inputs extends any[], Output extends any> {
|
|
|
13
13
|
constructor(ir: FunctionIR);
|
|
14
14
|
/** Compile the function for execution in JavaScript using a closure-compiler technique.
|
|
15
15
|
* Platform functions must be provided for the function to evaluate.
|
|
16
|
+
*
|
|
17
|
+
* @param platform - Array of platform function implementations
|
|
16
18
|
*/
|
|
17
19
|
compile(platform: PlatformFunction[]): (...inputs: {
|
|
18
20
|
[K in keyof Inputs]: ValueTypeOf<Inputs[K]>;
|
|
@@ -27,6 +29,8 @@ export declare class AsyncEastIR<Inputs extends any[], Output extends any> {
|
|
|
27
29
|
/** Compile the async function for execution in JavaScript using a closure-compiler technique.
|
|
28
30
|
* Platform functions must be provided for the function to evaluate, which may return `Promise`s.
|
|
29
31
|
* The compiled function itself returns a `Promise`.
|
|
32
|
+
*
|
|
33
|
+
* @param platform - Array of platform function implementations
|
|
30
34
|
*/
|
|
31
35
|
compile(platform: PlatformFunction[]): (...inputs: {
|
|
32
36
|
[K in keyof Inputs]: ValueTypeOf<Inputs[K]>;
|
package/dist/src/eastir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eastir.d.ts","sourceRoot":"","sources":["../../src/eastir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD;;GAEG;AACH,qBAAa,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,EAAE,MAAM,SAAS,GAAG;IACvC,EAAE,EAAE,UAAU;gBAAd,EAAE,EAAE,UAAU;IASjC
|
|
1
|
+
{"version":3,"file":"eastir.d.ts","sourceRoot":"","sources":["../../src/eastir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD;;GAEG;AACH,qBAAa,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,EAAE,MAAM,SAAS,GAAG;IACvC,EAAE,EAAE,UAAU;gBAAd,EAAE,EAAE,UAAU;IASjC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE;SAAG,CAAC,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAAE,KAAK,WAAW,CAAC,MAAM,CAAC;CAoC3H;AAED;;GAEG;AACH,qBAAa,WAAW,CAAC,MAAM,SAAS,GAAG,EAAE,EAAE,MAAM,SAAS,GAAG;IAC5C,EAAE,EAAE,eAAe;gBAAnB,EAAE,EAAE,eAAe;IAStC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE;SAAG,CAAC,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAAE,KAAK,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAsCpI"}
|
package/dist/src/eastir.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import {} from "./types.js";
|
|
6
|
-
import { compile_internal, ReturnException } from "./compile.js";
|
|
6
|
+
import { compile_internal, ReturnException, EAST_IR_SYMBOL } from "./compile.js";
|
|
7
7
|
import { analyzeIR } from "./analyze.js";
|
|
8
8
|
/** A helper class wrapping East's "intermediate representation" (IR) for a free function.
|
|
9
9
|
* The IR can be serialized and saved, or compiled so that the function can be executed.
|
|
@@ -21,18 +21,20 @@ export class EastIR {
|
|
|
21
21
|
}
|
|
22
22
|
/** Compile the function for execution in JavaScript using a closure-compiler technique.
|
|
23
23
|
* Platform functions must be provided for the function to evaluate.
|
|
24
|
+
*
|
|
25
|
+
* @param platform - Array of platform function implementations
|
|
24
26
|
*/
|
|
25
27
|
compile(platform) {
|
|
26
28
|
// Analyse the IR
|
|
27
|
-
const analyzed_ir = analyzeIR(this.ir, platform
|
|
29
|
+
const analyzed_ir = analyzeIR(this.ir, platform);
|
|
28
30
|
// compile the function (with no variables in environment)
|
|
29
31
|
const platformFns = Object.fromEntries(platform.map(fn => [fn.name, fn.fn]));
|
|
30
32
|
const asyncPlatformFns = new Set();
|
|
31
|
-
const compiled_expr = compile_internal(analyzed_ir, {}, platformFns, asyncPlatformFns);
|
|
33
|
+
const compiled_expr = compile_internal(analyzed_ir, {}, platformFns, asyncPlatformFns, platform);
|
|
32
34
|
// instantiate the function (with no environment)
|
|
33
35
|
const instantiated_function = compiled_expr({});
|
|
34
36
|
// Return sync wrapper
|
|
35
|
-
|
|
37
|
+
const wrapper = (...inputs) => {
|
|
36
38
|
try {
|
|
37
39
|
return instantiated_function(...inputs);
|
|
38
40
|
}
|
|
@@ -45,6 +47,14 @@ export class EastIR {
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
};
|
|
50
|
+
// Attach IR to wrapper for serialization support
|
|
51
|
+
Object.defineProperty(wrapper, EAST_IR_SYMBOL, {
|
|
52
|
+
value: this.ir,
|
|
53
|
+
writable: false,
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: false
|
|
56
|
+
});
|
|
57
|
+
return wrapper;
|
|
48
58
|
}
|
|
49
59
|
}
|
|
50
60
|
/** A helper class wrapping East's "intermediate representation" (IR) for a free async function.
|
|
@@ -64,18 +74,20 @@ export class AsyncEastIR {
|
|
|
64
74
|
/** Compile the async function for execution in JavaScript using a closure-compiler technique.
|
|
65
75
|
* Platform functions must be provided for the function to evaluate, which may return `Promise`s.
|
|
66
76
|
* The compiled function itself returns a `Promise`.
|
|
77
|
+
*
|
|
78
|
+
* @param platform - Array of platform function implementations
|
|
67
79
|
*/
|
|
68
80
|
compile(platform) {
|
|
69
81
|
// Analyse the IR
|
|
70
|
-
const analyzed_ir = analyzeIR(this.ir, platform
|
|
82
|
+
const analyzed_ir = analyzeIR(this.ir, platform);
|
|
71
83
|
// compile the function (with no variables in environment)
|
|
72
84
|
const platformFns = Object.fromEntries(platform.map(fn => [fn.name, fn.fn]));
|
|
73
85
|
const asyncPlatformFns = new Set(platform.filter(fn => fn.type === 'async').map(fn => fn.name));
|
|
74
|
-
const compiled_expr = compile_internal(analyzed_ir, {}, platformFns, asyncPlatformFns);
|
|
86
|
+
const compiled_expr = compile_internal(analyzed_ir, {}, platformFns, asyncPlatformFns, platform);
|
|
75
87
|
// instantiate the function (with no environment)
|
|
76
88
|
const instantiated_function = compiled_expr({});
|
|
77
89
|
// Return async wrapper
|
|
78
|
-
|
|
90
|
+
const wrapper = async (...inputs) => {
|
|
79
91
|
try {
|
|
80
92
|
return await instantiated_function(...inputs);
|
|
81
93
|
}
|
|
@@ -88,6 +100,14 @@ export class AsyncEastIR {
|
|
|
88
100
|
}
|
|
89
101
|
}
|
|
90
102
|
};
|
|
103
|
+
// Attach IR to wrapper for serialization support
|
|
104
|
+
Object.defineProperty(wrapper, EAST_IR_SYMBOL, {
|
|
105
|
+
value: this.ir,
|
|
106
|
+
writable: false,
|
|
107
|
+
enumerable: false,
|
|
108
|
+
configurable: false
|
|
109
|
+
});
|
|
110
|
+
return wrapper;
|
|
91
111
|
}
|
|
92
112
|
}
|
|
93
113
|
//# sourceMappingURL=eastir.js.map
|
package/dist/src/eastir.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eastir.js","sourceRoot":"","sources":["../../src/eastir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAoB,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"eastir.js","sourceRoot":"","sources":["../../src/eastir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAoB,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,MAAM,OAAO,MAAM;IACE;IAAnB,YAAmB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAC/B,IAAI,EAAE,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,uCAAuC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;QACnE,CAAC;QACD,IAAI,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;QACvE,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,QAA4B;QAClC,iBAAiB;QACjB,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAEjD,0DAA0D;QAC1D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3C,MAAM,aAAa,GAAG,gBAAgB,CAAC,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAEjG,iDAAiD;QACjD,MAAM,qBAAqB,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAEhD,sBAAsB;QACtB,MAAM,OAAO,GAAG,CAAC,GAAG,MAAa,EAAE,EAAE;YACnC,IAAI,CAAC;gBACH,OAAO,qBAAqB,CAAC,GAAG,MAAM,CAAC,CAAA;YACzC,CAAC;YAAC,OAAO,CAAU,EAAE,CAAC;gBACpB,IAAI,CAAC,YAAY,eAAe,EAAE,CAAC;oBACjC,OAAO,CAAC,CAAC,KAAK,CAAC;gBACjB,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,iDAAiD;QACjD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE;YAC7C,KAAK,EAAE,IAAI,CAAC,EAAE;YACd,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,WAAW;IACH;IAAnB,YAAmB,EAAmB;QAAnB,OAAE,GAAF,EAAE,CAAiB;QACpC,IAAI,EAAE,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,6CAA6C,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;QACzE,CAAC;QACD,IAAI,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,QAA4B;QAClC,iBAAiB;QACjB,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAEjD,0DAA0D;QAC1D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAC9D,CAAC;QAEF,MAAM,aAAa,GAAG,gBAAgB,CAAC,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAEjG,iDAAiD;QACjD,MAAM,qBAAqB,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAEhD,uBAAuB;QACvB,MAAM,OAAO,GAAG,KAAK,EAAE,GAAG,MAAa,EAAE,EAAE;YACzC,IAAI,CAAC;gBACH,OAAO,MAAM,qBAAqB,CAAC,GAAG,MAAM,CAAC,CAAA;YAC/C,CAAC;YAAC,OAAO,CAAU,EAAE,CAAC;gBACpB,IAAI,CAAC,YAAY,eAAe,EAAE,CAAC;oBACjC,OAAO,CAAC,CAAC,KAAK,CAAC;gBACjB,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,iDAAiD;QACjD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE;YAC7C,KAAK,EAAE,IAAI,CAAC,EAAE;YACd,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
package/dist/src/error.d.ts
CHANGED
|
@@ -3,11 +3,22 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import type { LocationValue } from "./ir.js";
|
|
6
|
+
/**
|
|
7
|
+
* Internal error for invariant violations in the East compiler/runtime.
|
|
8
|
+
* These indicate bugs in East itself, not user errors.
|
|
9
|
+
*/
|
|
10
|
+
export declare class InternalError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
6
13
|
export declare class EastError extends Error {
|
|
7
14
|
location: LocationValue[];
|
|
15
|
+
eastMessage: string;
|
|
8
16
|
constructor(message: string, options: {
|
|
9
17
|
cause?: any;
|
|
10
|
-
location: LocationValue;
|
|
18
|
+
location: LocationValue[];
|
|
11
19
|
});
|
|
20
|
+
toString(): string;
|
|
21
|
+
/** Format for use with Error.message */
|
|
22
|
+
get formattedMessage(): string;
|
|
12
23
|
}
|
|
13
24
|
//# sourceMappingURL=error.d.ts.map
|
package/dist/src/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,SAAU,SAAQ,KAAK;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,SAAU,SAAQ,KAAK;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE;IAMvE,QAAQ,IAAI,MAAM;IAkB3B,wCAAwC;IACxC,IAAI,gBAAgB,IAAI,MAAM,CAE7B;CACF"}
|
package/dist/src/error.js
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal error for invariant violations in the East compiler/runtime.
|
|
3
|
+
* These indicate bugs in East itself, not user errors.
|
|
4
|
+
*/
|
|
5
|
+
export class InternalError extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(`Internal East error: ${message}`);
|
|
8
|
+
this.name = "InternalError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
1
11
|
export class EastError extends Error {
|
|
2
12
|
location;
|
|
13
|
+
eastMessage;
|
|
3
14
|
constructor(message, options) {
|
|
4
15
|
super(message, options.cause === undefined ? undefined : { cause: options.cause });
|
|
5
|
-
this.
|
|
16
|
+
this.eastMessage = message;
|
|
17
|
+
this.location = [...options.location];
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
const loc = this.location[0];
|
|
21
|
+
const header = `${loc.filename}:${loc.line}:${loc.column}: ${this.eastMessage}`;
|
|
22
|
+
if (this.location.length <= 1) {
|
|
23
|
+
return header;
|
|
24
|
+
}
|
|
25
|
+
// Build stack trace (skip first since it's in the header)
|
|
26
|
+
const lines = [header, "Stack trace:"];
|
|
27
|
+
for (let i = this.location.length - 1; i >= 1; i--) {
|
|
28
|
+
const frame = this.location[i];
|
|
29
|
+
lines.push(` at ${frame.filename}:${frame.line}:${frame.column}`);
|
|
30
|
+
}
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
33
|
+
/** Format for use with Error.message */
|
|
34
|
+
get formattedMessage() {
|
|
35
|
+
return this.toString();
|
|
6
36
|
}
|
|
7
37
|
}
|
|
8
38
|
//# sourceMappingURL=error.js.map
|
package/dist/src/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAC3B,QAAQ,CAAkB;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,SAAU,SAAQ,KAAK;IAC3B,QAAQ,CAAkB;IAC1B,WAAW,CAAS;IAE3B,YAAY,OAAe,EAAE,OAAmD;QAC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAEQ,QAAQ;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhF,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,0DAA0D;QAC1D,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACvC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACnD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,wCAAwC;IACxC,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CACF"}
|
package/dist/src/expr/array.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import type { BooleanExpr } from "./boolean.js";
|
|
|
14
14
|
import type { SetExpr } from "./set.js";
|
|
15
15
|
import type { FloatExpr } from "./float.js";
|
|
16
16
|
import type { DictExpr } from "./dict.js";
|
|
17
|
+
import { type CsvSerializeOptions } from "../serialization/csv.js";
|
|
18
|
+
import type { BlobExpr } from "./blob.js";
|
|
17
19
|
/**
|
|
18
20
|
* Expression representing mutable array values and operations.
|
|
19
21
|
*
|
|
@@ -61,6 +63,22 @@ export declare class ArrayExpr<T extends any> extends Expr<ArrayType<T>> {
|
|
|
61
63
|
* ```
|
|
62
64
|
*/
|
|
63
65
|
size(): IntegerExpr;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the length of the array (an alias for size).
|
|
68
|
+
*
|
|
69
|
+
* @returns An IntegerExpr representing the number of elements
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const getLength = East.function([ArrayType(IntegerType)], IntegerType, ($, arr) => {
|
|
74
|
+
* $.return(arr.length());
|
|
75
|
+
* });
|
|
76
|
+
* const compiled = East.compile(getLength.toIR(), []);
|
|
77
|
+
* compiled([1n, 2n, 3n]); // 3n
|
|
78
|
+
* compiled([]); // 0n
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
length(): IntegerExpr;
|
|
64
82
|
/**
|
|
65
83
|
* Checks if an element exists at the specified index (i.e., if the index is in bounds).
|
|
66
84
|
*
|
|
@@ -106,6 +124,33 @@ export declare class ArrayExpr<T extends any> extends Expr<ArrayType<T>> {
|
|
|
106
124
|
* ```
|
|
107
125
|
*/
|
|
108
126
|
get(key: Expr<IntegerType> | bigint, defaultFn?: SubtypeExprOrValue<FunctionType<[IntegerType], T>>): ExprType<T>;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the element at the specified index (alias for get).
|
|
129
|
+
*
|
|
130
|
+
* @param key - The zero-based index
|
|
131
|
+
* @param defaultFn - Optional function to provide a default value for out-of-bounds indices
|
|
132
|
+
* @returns An expression of the array's element type
|
|
133
|
+
*
|
|
134
|
+
* @throws East runtime error if index is out of bounds and no defaultFn is provided
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const getElement = East.function([ArrayType(IntegerType), IntegerType], IntegerType, ($, arr, index) => {
|
|
139
|
+
* $.return(arr.get(index));
|
|
140
|
+
* });
|
|
141
|
+
* const compiled = East.compile(getElement.toIR(), []);
|
|
142
|
+
* compiled([10n, 20n, 30n], 1n); // 20n
|
|
143
|
+
* // compiled([10n, 20n, 30n], 5n) would throw error
|
|
144
|
+
*
|
|
145
|
+
* // With default value
|
|
146
|
+
* const getOrDefault = East.function([ArrayType(IntegerType), IntegerType], IntegerType, ($, arr, index) => {
|
|
147
|
+
* $.return(arr.get(index, ($, i) => -1n));
|
|
148
|
+
* });
|
|
149
|
+
* compiled = East.compile(getOrDefault.toIR(), []);
|
|
150
|
+
* compiled([10n, 20n, 30n], 5n); // -1n (out of bounds)
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
at(key: Expr<IntegerType> | bigint, defaultFn?: SubtypeExprOrValue<FunctionType<[IntegerType], T>>): ExprType<T>;
|
|
109
154
|
/**
|
|
110
155
|
* Safely gets the element at the specified index, returning an Option variant.
|
|
111
156
|
*
|
|
@@ -705,7 +750,7 @@ export declare class ArrayExpr<T extends any> extends Expr<ArrayType<T>> {
|
|
|
705
750
|
* compiled([{ name: "Alice", age: 30n }, { name: "Bob", age: 15n }]); // [{ name: "Alice", age: 30n }]
|
|
706
751
|
* ```
|
|
707
752
|
*/
|
|
708
|
-
filter(predicate: SubtypeExprOrValue<FunctionType<[T, IntegerType], BooleanType>>):
|
|
753
|
+
filter(predicate: SubtypeExprOrValue<FunctionType<[T, IntegerType], BooleanType>>): ArrayExpr<T>;
|
|
709
754
|
/**
|
|
710
755
|
* Filters and maps array elements in a single pass using an Option-returning function.
|
|
711
756
|
*
|
|
@@ -1707,5 +1752,68 @@ export declare class ArrayExpr<T extends any> extends Expr<ArrayType<T>> {
|
|
|
1707
1752
|
groupToDicts<K1, KeyFn2 extends (($: BlockBuilder<NeverType>, v: ExprType<T>, i: IntegerExpr) => any)>(keyFn: Expr<FunctionType<[T, IntegerType], K1>>, keyFn2: KeyFn2): DictExpr<K1, DictType<TypeOf<ReturnType<KeyFn2>>, T>>;
|
|
1708
1753
|
groupToDicts<KeyFn extends (($: BlockBuilder<NeverType>, v: ExprType<T>, i: IntegerExpr) => any), K2>(keyFn: KeyFn, keyFn2: Expr<FunctionType<[T, IntegerType], K2>>): DictExpr<TypeOf<ReturnType<KeyFn>>, DictType<K2, T>>;
|
|
1709
1754
|
groupToDicts<KeyFn extends (($: BlockBuilder<NeverType>, v: ExprType<T>, i: IntegerExpr) => any), KeyFn2 extends (($: BlockBuilder<NeverType>, v: ExprType<T>, i: IntegerExpr) => any)>(keyFn: KeyFn, keyFn2: KeyFn2): DictExpr<TypeOf<ReturnType<KeyFn>>, DictType<TypeOf<ReturnType<KeyFn2>>, T>>;
|
|
1755
|
+
/**
|
|
1756
|
+
* Encodes this array of structs as CSV data.
|
|
1757
|
+
*
|
|
1758
|
+
* @param options - CSV serialization options
|
|
1759
|
+
* @returns A BlobExpr containing the encoded CSV data
|
|
1760
|
+
*
|
|
1761
|
+
* @remarks Only works on arrays of structs with primitive or optional primitive fields.
|
|
1762
|
+
*
|
|
1763
|
+
* @example
|
|
1764
|
+
* ```ts
|
|
1765
|
+
* const PersonType = StructType({ name: StringType, age: IntegerType });
|
|
1766
|
+
*
|
|
1767
|
+
* const toCsv = East.function([ArrayType(PersonType)], BlobType, ($, people) => {
|
|
1768
|
+
* $.return(people.encodeCsv({ delimiter: ',' }));
|
|
1769
|
+
* });
|
|
1770
|
+
* const compiled = East.compile(toCsv.toIR(), []);
|
|
1771
|
+
* const blob = compiled([{ name: "Alice", age: 30n }, { name: "Bob", age: 25n }]);
|
|
1772
|
+
* new TextDecoder().decode(blob); // "name,age\r\nAlice,30\r\nBob,25"
|
|
1773
|
+
* ```
|
|
1774
|
+
*/
|
|
1775
|
+
encodeCsv(options?: CsvSerializeOptions): BlobExpr;
|
|
1776
|
+
/**
|
|
1777
|
+
* Checks if this array equals another array (deep comparison).
|
|
1778
|
+
*
|
|
1779
|
+
* @param other - The array to compare against
|
|
1780
|
+
* @returns A BooleanExpr that is true if the arrays are deeply equal
|
|
1781
|
+
*
|
|
1782
|
+
* @example
|
|
1783
|
+
* ```ts
|
|
1784
|
+
* const isEqual = East.function([ArrayType(IntegerType), ArrayType(IntegerType)], BooleanType, ($, a, b) => {
|
|
1785
|
+
* $.return(a.equals(b));
|
|
1786
|
+
* });
|
|
1787
|
+
* const compiled = East.compile(isEqual.toIR(), []);
|
|
1788
|
+
* compiled([1n, 2n, 3n], [1n, 2n, 3n]); // true
|
|
1789
|
+
* compiled([1n, 2n], [1n, 2n, 3n]); // false
|
|
1790
|
+
* ```
|
|
1791
|
+
*/
|
|
1792
|
+
equals(other: ArrayExpr<T> | SubtypeExprOrValue<T>[]): BooleanExpr;
|
|
1793
|
+
/**
|
|
1794
|
+
* Checks if this array does not equal another array.
|
|
1795
|
+
*
|
|
1796
|
+
* @param other - The array to compare against
|
|
1797
|
+
* @returns A BooleanExpr that is true if the arrays are not equal
|
|
1798
|
+
*
|
|
1799
|
+
* @example
|
|
1800
|
+
* ```ts
|
|
1801
|
+
* const isNotEqual = East.function([ArrayType(IntegerType), ArrayType(IntegerType)], BooleanType, ($, a, b) => {
|
|
1802
|
+
* $.return(a.notEquals(b));
|
|
1803
|
+
* });
|
|
1804
|
+
* const compiled = East.compile(isNotEqual.toIR(), []);
|
|
1805
|
+
* compiled([1n, 2n], [1n, 2n, 3n]); // true
|
|
1806
|
+
* compiled([1n, 2n, 3n], [1n, 2n, 3n]); // false
|
|
1807
|
+
* ```
|
|
1808
|
+
*/
|
|
1809
|
+
notEquals(other: ArrayExpr<T> | SubtypeExprOrValue<T>[]): BooleanExpr;
|
|
1810
|
+
/** Alias for {@link equals} */
|
|
1811
|
+
eq: (other: ArrayExpr<T> | SubtypeExprOrValue<T>[]) => BooleanExpr;
|
|
1812
|
+
/** Alias for {@link equals} */
|
|
1813
|
+
equal: (other: ArrayExpr<T> | SubtypeExprOrValue<T>[]) => BooleanExpr;
|
|
1814
|
+
/** Alias for {@link notEquals} */
|
|
1815
|
+
ne: (other: ArrayExpr<T> | SubtypeExprOrValue<T>[]) => BooleanExpr;
|
|
1816
|
+
/** Alias for {@link notEquals} */
|
|
1817
|
+
notEqual: (other: ArrayExpr<T> | SubtypeExprOrValue<T>[]) => BooleanExpr;
|
|
1710
1818
|
}
|
|
1711
1819
|
//# sourceMappingURL=array.d.ts.map
|