@mirascript/mirascript 0.1.16 → 0.1.17
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/{chunk-YZGL3D7L.js → chunk-JG3D67GF.js} +12 -84
- package/dist/chunk-JG3D67GF.js.map +6 -0
- package/dist/{chunk-LU4ZKFF6.js → chunk-W2I5XPIE.js} +112 -33
- package/dist/chunk-W2I5XPIE.js.map +6 -0
- package/dist/cli/index.js +2 -2
- package/dist/compiler/emit/sourcemap.d.ts.map +1 -1
- package/dist/compiler/worker.js +1 -1
- package/dist/helpers/convert/index.d.ts +5 -0
- package/dist/helpers/convert/index.d.ts.map +1 -0
- package/dist/helpers/convert/to-boolean.d.ts +4 -0
- package/dist/helpers/convert/to-boolean.d.ts.map +1 -0
- package/dist/helpers/convert/to-format.d.ts +4 -0
- package/dist/helpers/convert/to-format.d.ts.map +1 -0
- package/dist/helpers/convert/to-number.d.ts +4 -0
- package/dist/helpers/convert/to-number.d.ts.map +1 -0
- package/dist/helpers/convert/to-string.d.ts +6 -0
- package/dist/helpers/convert/to-string.d.ts.map +1 -0
- package/dist/helpers/serialize.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/subtle.d.ts +2 -2
- package/dist/subtle.d.ts.map +1 -1
- package/dist/subtle.js +3 -5
- package/dist/vm/helpers.d.ts.map +1 -1
- package/dist/vm/lib/global/bit.d.ts +7 -7
- package/dist/vm/lib/global/bit.d.ts.map +1 -1
- package/dist/vm/lib/global/json.d.ts +2 -2
- package/dist/vm/lib/global/json.d.ts.map +1 -1
- package/dist/vm/lib/global/math-additional.d.ts +1 -1
- package/dist/vm/lib/global/math-additional.d.ts.map +1 -1
- package/dist/vm/lib/global/math-arr.d.ts +5 -5
- package/dist/vm/lib/global/math-arr.d.ts.map +1 -1
- package/dist/vm/lib/global/math-unary.d.ts +26 -26
- package/dist/vm/lib/global/math-unary.d.ts.map +1 -1
- package/dist/vm/lib/global/math.d.ts +3 -3
- package/dist/vm/lib/global/math.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/all-any.d.ts +2 -2
- package/dist/vm/lib/global/sequence/all-any.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/entries.d.ts +3 -3
- package/dist/vm/lib/global/sequence/entries.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/find.d.ts +1 -1
- package/dist/vm/lib/global/sequence/find.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/flatten.d.ts +1 -1
- package/dist/vm/lib/global/sequence/flatten.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/len.d.ts +1 -1
- package/dist/vm/lib/global/sequence/len.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/map-filter.d.ts +3 -3
- package/dist/vm/lib/global/sequence/map-filter.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/repeat.d.ts +1 -1
- package/dist/vm/lib/global/sequence/repeat.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/reverse.d.ts +1 -1
- package/dist/vm/lib/global/sequence/reverse.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/sort.d.ts +2 -2
- package/dist/vm/lib/global/sequence/sort.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/with.d.ts +1 -1
- package/dist/vm/lib/global/sequence/with.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/zip.d.ts +1 -1
- package/dist/vm/lib/global/sequence/zip.d.ts.map +1 -1
- package/dist/vm/lib/global/string.d.ts +10 -10
- package/dist/vm/lib/global/string.d.ts.map +1 -1
- package/dist/vm/lib/global/time.d.ts +3 -3
- package/dist/vm/lib/global/time.d.ts.map +1 -1
- package/dist/vm/lib/global/to-primitive.d.ts +4 -4
- package/dist/vm/lib/global/to-primitive.d.ts.map +1 -1
- package/dist/vm/lib/helpers.d.ts +1 -1
- package/dist/vm/lib/helpers.d.ts.map +1 -1
- package/dist/vm/lib/index.d.ts +1 -1
- package/dist/vm/lib/index.d.ts.map +1 -1
- package/dist/vm/lib/mod/matrix.d.ts +13 -13
- package/dist/vm/lib/mod/matrix.d.ts.map +1 -1
- package/dist/vm/operations.d.ts.map +1 -1
- package/dist/vm/types/context.d.ts +3 -17
- package/dist/vm/types/context.d.ts.map +1 -1
- package/dist/vm/types/index.d.ts +1 -1
- package/dist/vm/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/compiler/emit/globals.ts +1 -1
- package/src/compiler/emit/sourcemap.ts +8 -3
- package/src/helpers/convert/index.ts +4 -0
- package/src/helpers/convert/to-boolean.ts +12 -0
- package/src/helpers/convert/to-format.ts +37 -0
- package/src/helpers/convert/to-number.ts +35 -0
- package/src/helpers/convert/to-string.ts +55 -0
- package/src/helpers/serialize.ts +1 -0
- package/src/subtle.ts +2 -2
- package/src/vm/helpers.ts +1 -1
- package/src/vm/lib/global/debug.ts +1 -1
- package/src/vm/lib/global/sequence/all-any.ts +1 -1
- package/src/vm/lib/global/sequence/find.ts +1 -1
- package/src/vm/lib/global/sequence/map-filter.ts +1 -1
- package/src/vm/lib/global/sequence/sort.ts +1 -1
- package/src/vm/lib/global/sequence/with.ts +1 -1
- package/src/vm/lib/global/time.ts +1 -1
- package/src/vm/lib/global/to-primitive.ts +1 -1
- package/src/vm/lib/helpers.ts +4 -4
- package/src/vm/lib/index.ts +4 -4
- package/src/vm/lib/mod/matrix.ts +1 -1
- package/src/vm/operations.ts +11 -12
- package/src/vm/types/context.ts +26 -38
- package/src/vm/types/extern.ts +1 -1
- package/src/vm/types/index.ts +1 -1
- package/dist/chunk-LU4ZKFF6.js.map +0 -6
- package/dist/chunk-YZGL3D7L.js.map +0 -6
- package/dist/helpers/convert.d.ts +0 -12
- package/dist/helpers/convert.d.ts.map +0 -1
- package/src/helpers/convert.ts +0 -128
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const flatten: ((data: import("../../../index.js").VmValue | undefined, depth?: import("../../../index.js").VmValue | undefined) => (string | number | boolean | import("../../../index.js").VmRecord | import("../../../index.js").VmArray | null | undefined)[]) & import("../../helpers.js").VmLibOption & Record<
|
|
1
|
+
export declare const flatten: ((data: import("../../../index.js").VmValue | undefined, depth?: import("../../../index.js").VmValue | undefined) => (string | number | boolean | import("../../../index.js").VmRecord | import("../../../index.js").VmArray | null | undefined)[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
2
2
|
//# sourceMappingURL=flatten.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/flatten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/flatten.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,qTAYnB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const len: ((arr: import("../../../index.js").VmValue | undefined) => number) & import("../../helpers.js").VmLibOption & Record<
|
|
1
|
+
export declare const len: ((arr: import("../../../index.js").VmValue | undefined) => number) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
2
2
|
//# sourceMappingURL=len.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"len.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/len.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"len.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/len.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,oIAYf,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type VmValue } from '../../../types/index.js';
|
|
|
2
2
|
export * from './with.js';
|
|
3
3
|
export * from './entries.js';
|
|
4
4
|
export * from './len.js';
|
|
5
|
-
export declare const map: ((data: VmValue | undefined, f: VmValue | undefined) => VmValue) & import("../../helpers.js").VmLibOption & Record<
|
|
6
|
-
export declare const filter: ((data: VmValue | undefined, predicate: VmValue | undefined) => VmValue) & import("../../helpers.js").VmLibOption & Record<
|
|
7
|
-
export declare const filter_map: ((data: VmValue | undefined, f: VmValue | undefined) => VmValue) & import("../../helpers.js").VmLibOption & Record<
|
|
5
|
+
export declare const map: ((data: VmValue | undefined, f: VmValue | undefined) => VmValue) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
6
|
+
export declare const filter: ((data: VmValue | undefined, predicate: VmValue | undefined) => VmValue) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
7
|
+
export declare const filter_map: ((data: VmValue | undefined, f: VmValue | undefined) => VmValue) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
8
8
|
//# sourceMappingURL=map-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-filter.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/map-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAG9E,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAkBzB,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"map-filter.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/map-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAG9E,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAkBzB,eAAO,MAAM,GAAG,kIAef,CAAC;AAEF,eAAO,MAAM,MAAM,0IAmBlB,CAAC;AAEF,eAAO,MAAM,UAAU,kIAmBtB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { VmConst } from '../../../types/index.js';
|
|
2
|
-
export declare const repeat: ((data: import("../../../types/index.js").VmValue | undefined, times: import("../../../types/index.js").VmValue | undefined) => VmConst[]) & import("../../helpers.js").VmLibOption & Record<
|
|
2
|
+
export declare const repeat: ((data: import("../../../types/index.js").VmValue | undefined, times: import("../../../types/index.js").VmValue | undefined) => VmConst[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
3
|
//# sourceMappingURL=repeat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/repeat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGvD,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/repeat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGvD,eAAO,MAAM,MAAM,4MAsBlB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const reverse: ((arr: import("../../../index.js").VmValue | undefined) => (import("../../../index.js").VmConst | undefined)[]) & import("../../helpers.js").VmLibOption & Record<
|
|
1
|
+
export declare const reverse: ((arr: import("../../../index.js").VmValue | undefined) => (import("../../../index.js").VmConst | undefined)[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
2
2
|
//# sourceMappingURL=reverse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/reverse.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/reverse.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,iLAcnB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { VmConst, VmValue } from '../../../types/index.js';
|
|
2
|
-
export declare const sort: ((data: VmValue | undefined, comparator: VmValue | undefined) => VmConst[]) & import("../../helpers.js").VmLibOption & Record<
|
|
3
|
-
export declare const sort_by: ((data: VmValue | undefined, key_fn: VmValue | undefined, comparator: VmValue | undefined) => VmConst[]) & import("../../helpers.js").VmLibOption & Record<
|
|
2
|
+
export declare const sort: ((data: VmValue | undefined, comparator: VmValue | undefined) => VmConst[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const sort_by: ((data: VmValue | undefined, key_fn: VmValue | undefined, comparator: VmValue | undefined) => VmConst[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
4
4
|
//# sourceMappingURL=sort.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA+BvE,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA+BvE,eAAO,MAAM,IAAI,6IAwBhB,CAAC;AAEF,eAAO,MAAM,OAAO,0KAgCnB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { VmArray, VmValue } from '../../../types/index.js';
|
|
2
|
-
declare const _with: ((data: VmValue | undefined, ...entries: (VmValue | undefined)[]) => import("../../../types/index.js").VmRecord | VmArray) & import("../../helpers.js").VmLibOption & Record<
|
|
2
|
+
declare const _with: ((data: VmValue | undefined, ...entries: (VmValue | undefined)[]) => import("../../../types/index.js").VmRecord | VmArray) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
3
|
export { _with as 'with' };
|
|
4
4
|
//# sourceMappingURL=with.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/with.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAW,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAuEzE,QAAA,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"with.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/with.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAW,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAuEzE,QAAA,MAAM,KAAK,4LA4DV,CAAC;AACF,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type VmConst } from '../../../types/index.js';
|
|
2
|
-
export declare const zip: ((data: import("../../../types/index.js").VmValue | undefined) => Record<string | number, VmConst>[]) & import("../../helpers.js").VmLibOption & Record<
|
|
2
|
+
export declare const zip: ((data: import("../../../types/index.js").VmValue | undefined) => Record<string | number, VmConst>[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
3
|
//# sourceMappingURL=zip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/zip.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AAIhF,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/zip.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AAIhF,eAAO,MAAM,GAAG,uKAiCf,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare const chars: ((str: import("../../index.js").VmValue | undefined) => string[]) & import("../helpers.js").VmLibOption & Record<
|
|
2
|
-
export declare const starts_with: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined) => boolean) & import("../helpers.js").VmLibOption & Record<
|
|
3
|
-
export declare const ends_with: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined) => boolean) & import("../helpers.js").VmLibOption & Record<
|
|
4
|
-
export declare const contains: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined) => boolean) & import("../helpers.js").VmLibOption & Record<
|
|
5
|
-
export declare const trim_start: ((str: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<
|
|
6
|
-
export declare const trim_end: ((str: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<
|
|
7
|
-
export declare const trim: ((str: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<
|
|
8
|
-
export declare const replace: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined, replacement?: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<
|
|
9
|
-
export declare const split: ((str: import("../../index.js").VmValue | undefined, separator?: import("../../index.js").VmValue | undefined) => string[]) & import("../helpers.js").VmLibOption & Record<
|
|
10
|
-
export declare const join: ((arr: import("../../index.js").VmValue | undefined, separator?: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<
|
|
1
|
+
export declare const chars: ((str: import("../../index.js").VmValue | undefined) => string[]) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
2
|
+
export declare const starts_with: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined) => boolean) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const ends_with: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined) => boolean) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
4
|
+
export declare const contains: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined) => boolean) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
5
|
+
export declare const trim_start: ((str: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
6
|
+
export declare const trim_end: ((str: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
7
|
+
export declare const trim: ((str: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
8
|
+
export declare const replace: ((str: import("../../index.js").VmValue | undefined, search: import("../../index.js").VmValue | undefined, replacement?: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
9
|
+
export declare const split: ((str: import("../../index.js").VmValue | undefined, separator?: import("../../index.js").VmValue | undefined) => string[]) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
10
|
+
export declare const join: ((arr: import("../../index.js").VmValue | undefined, separator?: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
11
11
|
//# sourceMappingURL=string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/string.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/string.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,gIAWjB,CAAC;AAEF,eAAO,MAAM,WAAW,qLAWvB,CAAC;AACF,eAAO,MAAM,SAAS,qLAWrB,CAAC;AAEF,eAAO,MAAM,QAAQ,qLAWpB,CAAC;AAEF,eAAO,MAAM,UAAU,8HAWtB,CAAC;AAEF,eAAO,MAAM,QAAQ,8HAWpB,CAAC;AAEF,eAAO,MAAM,IAAI,8HAWhB,CAAC;AAEF,eAAO,MAAM,OAAO,gPAcnB,CAAC;AAEF,eAAO,MAAM,KAAK,0LAcjB,CAAC;AAEF,eAAO,MAAM,IAAI,wLAahB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const to_timestamp: ((datetime: import("../../types/index.js").VmValue | undefined, fallback: import("../../types/index.js").VmValue | undefined) => import("../../types/index.js").VmValue | undefined) & import("../helpers.js").VmLibOption & Record<
|
|
2
|
-
export declare const to_datetime: ((datetime: import("../../types/index.js").VmValue | undefined, offset: import("../../types/index.js").VmValue | undefined, fallback: import("../../types/index.js").VmValue | undefined) => import("../../types/index.js").VmValue | undefined) & import("../helpers.js").VmLibOption & Record<
|
|
3
|
-
export declare const to_iso8601: ((datetime: import("../../types/index.js").VmValue | undefined, fallback: import("../../types/index.js").VmValue | undefined) => import("../../types/index.js").VmValue | undefined) & import("../helpers.js").VmLibOption & Record<
|
|
1
|
+
export declare const to_timestamp: ((datetime: import("../../types/index.js").VmValue | undefined, fallback: import("../../types/index.js").VmValue | undefined) => import("../../types/index.js").VmValue | undefined) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
2
|
+
export declare const to_datetime: ((datetime: import("../../types/index.js").VmValue | undefined, offset: import("../../types/index.js").VmValue | undefined, fallback: import("../../types/index.js").VmValue | undefined) => import("../../types/index.js").VmValue | undefined) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const to_iso8601: ((datetime: import("../../types/index.js").VmValue | undefined, fallback: import("../../types/index.js").VmValue | undefined) => import("../../types/index.js").VmValue | undefined) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
4
4
|
//# sourceMappingURL=time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/time.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/time.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,YAAY,mPAgBxB,CAAC;AAEF,eAAO,MAAM,WAAW,+SAsCvB,CAAC;AAEF,eAAO,MAAM,UAAU,mPAgBtB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const to_string: ((data: import("../../index.js").VmValue | undefined, fallback: import("../../index.js").VmValue | undefined) => string | number | boolean | import("../../index.js").VmRecord | import("../../index.js").VmArray | import("../../index.js").VmFunction | import("../../index.js").VmModule<Record<string, import("../../index.js").VmImmutable>> | import("../../index.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<
|
|
2
|
-
export declare const to_number: ((data: import("../../index.js").VmValue | undefined, fallback: import("../../index.js").VmValue | undefined) => string | number | boolean | import("../../index.js").VmRecord | import("../../index.js").VmArray | import("../../index.js").VmFunction | import("../../index.js").VmModule<Record<string, import("../../index.js").VmImmutable>> | import("../../index.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<
|
|
3
|
-
export declare const to_boolean: ((data: import("../../index.js").VmValue | undefined, fallback: import("../../index.js").VmValue | undefined) => string | number | boolean | import("../../index.js").VmRecord | import("../../index.js").VmArray | import("../../index.js").VmFunction | import("../../index.js").VmModule<Record<string, import("../../index.js").VmImmutable>> | import("../../index.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<
|
|
4
|
-
export declare const format: ((data: import("../../index.js").VmValue | undefined, format: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<
|
|
1
|
+
export declare const to_string: ((data: import("../../index.js").VmValue | undefined, fallback: import("../../index.js").VmValue | undefined) => string | number | boolean | import("../../index.js").VmRecord | import("../../index.js").VmArray | import("../../index.js").VmFunction | import("../../index.js").VmModule<Record<string, import("../../index.js").VmImmutable>> | import("../../index.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
2
|
+
export declare const to_number: ((data: import("../../index.js").VmValue | undefined, fallback: import("../../index.js").VmValue | undefined) => string | number | boolean | import("../../index.js").VmRecord | import("../../index.js").VmArray | import("../../index.js").VmFunction | import("../../index.js").VmModule<Record<string, import("../../index.js").VmImmutable>> | import("../../index.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const to_boolean: ((data: import("../../index.js").VmValue | undefined, fallback: import("../../index.js").VmValue | undefined) => string | number | boolean | import("../../index.js").VmRecord | import("../../index.js").VmArray | import("../../index.js").VmFunction | import("../../index.js").VmModule<Record<string, import("../../index.js").VmImmutable>> | import("../../index.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
4
|
+
export declare const format: ((data: import("../../index.js").VmValue | undefined, format: import("../../index.js").VmValue | undefined) => string) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
5
5
|
//# sourceMappingURL=to-primitive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-primitive.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/to-primitive.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"to-primitive.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/to-primitive.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,ocAerB,CAAC;AAEF,eAAO,MAAM,SAAS,ocAerB,CAAC;AAEF,eAAO,MAAM,UAAU,ocAetB,CAAC;AAEF,eAAO,MAAM,MAAM,qLAYlB,CAAC"}
|
package/dist/vm/lib/helpers.d.ts
CHANGED
|
@@ -48,6 +48,6 @@ export type VmLibOption = Pick<VmFunctionOption, 'summary' | 'params' | 'paramsT
|
|
|
48
48
|
/** 库函数 */
|
|
49
49
|
export type VmLib<T extends VmFunctionLike = VmFunctionLike> = T & VmLibOption;
|
|
50
50
|
/** 创建库函数 */
|
|
51
|
-
export declare function VmLib<T extends VmFunctionLike, P extends Record<string, unknown>>(fn: T, option: VmLibOption, properties?: P): VmLib<T> & P;
|
|
51
|
+
export declare function VmLib<const T extends VmFunctionLike, P extends Record<string, unknown> = Record<never, never>>(fn: T, option: VmLibOption, properties?: P): VmLib<T> & P;
|
|
52
52
|
export {};
|
|
53
53
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/vm/lib/helpers.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,QAAQ,EACR,UAAU,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,cAAc,EACd,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,WAAW;AACX,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,CAGnF;AACD,WAAW;AACX,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AACzC,WAAW;AACX,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAQtD;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GACjC,KAAK,CAEP;AACD,gBAAgB;AAChB,wBAAgB,yBAAyB,CACrC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GACjC,KAAK,CAEP;AAED,aAAa;AACb,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,CAGpG;AAED,eAAe;AACf,wBAAgB,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,OAAO,EACtC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EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,GAC9F,OAAO,CAwBT;AAED,YAAY;AACZ,MAAM,MAAM,WAAW,GAAG,IAAI,CAC1B,gBAAgB,EAChB,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAC/E,CAAC;AACF,UAAU;AACV,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI,CAAC,GAAG,WAAW,CAAC;AAE/E,YAAY;AACZ,wBAAgB,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC1G,EAAE,EAAE,CAAC,EACL,MAAM,EAAE,WAAW,EACnB,UAAU,CAAC,EAAE,CAAC,GACf,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAcd"}
|
package/dist/vm/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as global from './global/index.js';
|
|
2
2
|
import * as mods from './mod/index.js';
|
|
3
|
-
export declare const lib: Readonly<
|
|
3
|
+
export declare const lib: Readonly<typeof global & typeof mods>;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vm/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAcvC,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vm/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAcvC,eAAO,MAAM,GAAG,EAAE,QAAQ,CAAC,OAAO,MAAM,GAAG,OAAO,IAAI,CAA4D,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type VmArray, type VmConst, type VmValue } from '../../types/index.js';
|
|
2
|
-
export declare const size: ((matrix: VmValue | undefined) => [] | [number, number] | [number]) & import("../helpers.js").VmLibOption & Record<
|
|
3
|
-
export declare const transpose: ((matrix: VmValue | undefined) => string | number | boolean | import("../../types/index.js").VmRecord | VmArray | import("../../types/function.js").VmFunction | import("../../types/module.js").VmModule<Record<string, import("../../types/index.js").VmImmutable>> | import("../../types/extern.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<
|
|
4
|
-
export declare const entrywise: ((a: VmValue | undefined, b: VmValue | undefined, f: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
5
|
-
export declare const add: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
6
|
-
export declare const subtract: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
7
|
-
export declare const entrywise_multiply: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
8
|
-
export declare const entrywise_divide: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
9
|
-
export declare const multiply: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
10
|
-
export declare const invert: ((a: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<
|
|
11
|
-
export declare const zeros: ((...size: readonly (VmValue | undefined)[]) => VmArray) & import("../helpers.js").VmLibOption & Record<
|
|
12
|
-
export declare const ones: ((...size: readonly (VmValue | undefined)[]) => VmArray) & import("../helpers.js").VmLibOption & Record<
|
|
13
|
-
export declare const identity: ((...size: readonly (VmValue | undefined)[]) => number[][]) & import("../helpers.js").VmLibOption & Record<
|
|
14
|
-
export declare const diagonal: ((x: VmValue | undefined, k?: VmValue | undefined) => VmConst[]) & import("../helpers.js").VmLibOption & Record<
|
|
2
|
+
export declare const size: ((matrix: VmValue | undefined) => [] | [number, number] | [number]) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const transpose: ((matrix: VmValue | undefined) => string | number | boolean | import("../../types/index.js").VmRecord | VmArray | import("../../types/function.js").VmFunction | import("../../types/module.js").VmModule<Record<string, import("../../types/index.js").VmImmutable>> | import("../../types/extern.js").VmExtern<object> | null) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
4
|
+
export declare const entrywise: ((a: VmValue | undefined, b: VmValue | undefined, f: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
5
|
+
export declare const add: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
6
|
+
export declare const subtract: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
7
|
+
export declare const entrywise_multiply: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
8
|
+
export declare const entrywise_divide: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
9
|
+
export declare const multiply: ((a: VmValue | undefined, b: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
10
|
+
export declare const invert: ((a: VmValue | undefined) => VmConst) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
11
|
+
export declare const zeros: ((...size: readonly (VmValue | undefined)[]) => VmArray) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
12
|
+
export declare const ones: ((...size: readonly (VmValue | undefined)[]) => VmArray) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
13
|
+
export declare const identity: ((...size: readonly (VmValue | undefined)[]) => number[][]) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
14
|
+
export declare const diagonal: ((x: VmValue | undefined, k?: VmValue | undefined) => VmConst[]) & import("../helpers.js").VmLibOption & Record<never, never>;
|
|
15
15
|
//# sourceMappingURL=matrix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/mod/matrix.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAsClH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/mod/matrix.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAsClH,eAAO,MAAM,IAAI,kIAYhB,CAAC;AAEF,eAAO,MAAM,SAAS,+XA0BrB,CAAC;AA8HF,eAAO,MAAM,SAAS,oJAmBrB,CAAC;AAEF,eAAO,MAAM,GAAG,4HAaf,CAAC;AAEF,eAAO,MAAM,QAAQ,4HAapB,CAAC;AAEF,eAAO,MAAM,kBAAkB,4HAa9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,4HAa5B,CAAC;AAEF,eAAO,MAAM,QAAQ,4HAiEpB,CAAC;AAEF,eAAO,MAAM,MAAM,oGAsHlB,CAAC;AAkBF,eAAO,MAAM,KAAK,uHAMhB,CAAC;AAEH,eAAO,MAAM,IAAI,uHAMf,CAAC;AAEH,eAAO,MAAM,QAAQ,0HA0BpB,CAAC;AAEF,eAAO,MAAM,QAAQ,+HA4CpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/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GjD,CAAC;AACF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,MAGjD,CAAC;AACF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,QAGjD,CAAC;AACF,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,OAGhD,CAAC;AACF,eAAO,MAAM,aAAa,GAAI,OAAO,KAAK,KAAG,QAAQ,KAAK,IAAI,WAAW,CAAC,OAAO,CAIhF,CAAC;AACF,eAAO,MAAM,IAAI,GAAI,KAAK,KAAK,EAAE,KAAK,KAAK,KAAG,OAM7C,CAAC;AACF,eAAO,MAAM,IAAI,GAAI,KAAK,KAAK,EAAE,KAAK,KAAK,KAAG,OAY7C,CAAC;AACF,eAAO,MAAM,IAAI,GAAI,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,KAAG,IAO3D,CAAC;AACF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,KAAG,QAAQ,CAAC,OAAO,GAAG,SAAS,CAMpE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,KAAG,QAAQ,GAAG,IAwBxD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,QAAQ,CAAC,OAAO,GAAG,SAAS,CAiBvE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,EAAE,QAAQ,KAAK,KAAG,MAIrD,CAAC"}
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import { kVmContext } from '../../helpers/constants.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type { VmAny, VmImmutable, VmValue, VmFunctionLike, VmModule } from './index.js';
|
|
4
|
-
import { VmFunction } from './function.js';
|
|
5
|
-
/** 全局导入的标准库值 */
|
|
6
|
-
type ToLibValue<V> = V extends VmFunctionLike ? VmFunction<V> : V extends Record<string, VmImmutable | VmFunctionLike> ? ToLibModule<V> : V;
|
|
7
|
-
/** 全局导入的标准库值 */
|
|
8
|
-
type ToLibModule<V extends Record<string, VmImmutable | VmFunctionLike>> = VmModule<{
|
|
9
|
-
[key in keyof V]: ToLibValue<V[key]>;
|
|
10
|
-
}>;
|
|
11
|
-
/** 全局导入的标准库 */
|
|
12
|
-
type VmContextBase = {
|
|
13
|
-
[key in keyof typeof lib]: ToLibValue<(typeof lib)[key]>;
|
|
14
|
-
};
|
|
15
|
-
/** MiraScript 执行上下文的基础,仅包含标准库 */
|
|
16
|
-
export type VmSharedContext = VmContextBase & Record<string, VmImmutable>;
|
|
2
|
+
import type { VmAny, VmImmutable, VmValue } from './index.js';
|
|
17
3
|
/** MiraScript 执行上下文 */
|
|
18
4
|
export interface VmContext {
|
|
19
5
|
/** 内部标识符 */
|
|
20
6
|
readonly [kVmContext]: true;
|
|
21
7
|
/** 枚举所有 key,仅在 LSP 中使用 */
|
|
22
|
-
keys():
|
|
8
|
+
keys(): readonly string[];
|
|
23
9
|
/** 描述值,返回 MarkDown 文本,仅在 LSP 中使用 */
|
|
24
10
|
describe?(key: string): string | undefined;
|
|
25
11
|
/**
|
|
@@ -34,7 +20,7 @@ export interface VmContext {
|
|
|
34
20
|
export type VmContextRecord = Record<string, VmValue>;
|
|
35
21
|
/** MiraScript 执行上下文 */
|
|
36
22
|
export type VmContextRecordLoose = Record<string, VmValue | undefined>;
|
|
37
|
-
export declare const
|
|
23
|
+
export declare const VM_SHARED_CONTEXT: Record<string, VmImmutable>;
|
|
38
24
|
/** 定义在所有 MiraScript 执行上下文中共享的全局变量 */
|
|
39
25
|
export declare function defineVmContextValue(name: string, value: VmImmutable | ((...args: VmAny[]) => VmAny), override?: boolean): void;
|
|
40
26
|
/** 无后备的实现 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/vm/types/context.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,K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S;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS;IACzD,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS;CACvE,CAAC;AACF,kBAAkB;AAClB,KAAK,0BAA0B,GAAG,SAAS;IACvC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS;IAC5C,UAAU,CAAC,EAAE,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;IACxD,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS;CACvE,CAAC;AAEF,qBAAqB;AACrB,wBAAgB,eAAe,CAAC,GAAG,IAAI,EAAE,yBAAyB,GAAG,0BAA0B,GAAG,SAAS,CAwB1G"}
|
package/dist/vm/types/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface VmValueMap {
|
|
|
51
51
|
}
|
|
52
52
|
export { isVmAny, isVmArray, isVmArrayLikeRecord, isVmArrayLikeRecordByEntires, isVmArrayLikeRecordByKeys, isVmCallable, isVmConst, isVmContext, isVmExtern, isVmFunction, isVmImmutable, isVmModule, isVmPrimitive, isVmRecord, isVmScript, isVmValue, isVmWrapper, getVmFunctionInfo, } from '../../helpers/types.js';
|
|
53
53
|
export { wrapToVmValue, unwrapFromVmValue } from './boundary.js';
|
|
54
|
-
export { type VmContext,
|
|
54
|
+
export { type VmContext, defineVmContextValue, createVmContext } from './context.js';
|
|
55
55
|
export { VmExtern } from './extern.js';
|
|
56
56
|
export { VmFunction, type VmFunctionInfo, type VmFunctionLike, type VmFunctionOption } from './function.js';
|
|
57
57
|
export { VmModule } from './module.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.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QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirascript/mirascript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"author": "CloudPSS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "An expression based scripting language.",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"commander": "^14.0.2",
|
|
37
37
|
"source-map-js": "^1.2.1",
|
|
38
38
|
"supports-color": "^10.2.2",
|
|
39
|
-
"@mirascript/bindings": "~0.1.
|
|
39
|
+
"@mirascript/bindings": "~0.1.17"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^24.10.1",
|
|
@@ -5,9 +5,14 @@ import { GLOBAL_HINT, SCRIPT_PREFIX } from './constants.js';
|
|
|
5
5
|
import type { GlobalMap } from './globals.js';
|
|
6
6
|
|
|
7
7
|
const ORIGIN = `mira://MiraScript/`;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
8
|
+
const { SOURCE_URL, SOURCE_MAPPING_URL } = ((source, mapping, url) => {
|
|
9
|
+
// 避免被识别为当前文件的源映射
|
|
10
|
+
const prefix = '//# ';
|
|
11
|
+
return {
|
|
12
|
+
SOURCE_URL: prefix.concat(source, url),
|
|
13
|
+
SOURCE_MAPPING_URL: prefix.concat(source, mapping, url),
|
|
14
|
+
};
|
|
15
|
+
})(`source`, `Mapping`, `URL`);
|
|
11
16
|
// 前两行固定为:
|
|
12
17
|
// (function anonymous($Add,$Aeq, ...
|
|
13
18
|
// ) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VmAny } from '../../vm/index.js';
|
|
2
|
+
import { VmError } from '../error.js';
|
|
3
|
+
import { display } from '../serialize.js';
|
|
4
|
+
|
|
5
|
+
/** 转换为 boolean */
|
|
6
|
+
export function toBoolean<F = undefined>(value: VmAny, fallback?: F): boolean | Exclude<F, undefined> {
|
|
7
|
+
if (typeof value === 'boolean') return value;
|
|
8
|
+
if (fallback === undefined) {
|
|
9
|
+
throw new VmError(`Failed to convert value to boolean: ${display(value)}`, false);
|
|
10
|
+
}
|
|
11
|
+
return fallback as Exclude<F, undefined>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { VmAny } from '../../vm/index.js';
|
|
2
|
+
import { isFinite } from '../utils.js';
|
|
3
|
+
import { toString } from './to-string.js';
|
|
4
|
+
|
|
5
|
+
/** 渲染数字 */
|
|
6
|
+
function formatNumber(value: number): string {
|
|
7
|
+
if (!isFinite(value)) return toString(value, undefined as never);
|
|
8
|
+
if (value === 0) return '0';
|
|
9
|
+
const s = value.toString();
|
|
10
|
+
let ps;
|
|
11
|
+
const abs = Math.abs(value);
|
|
12
|
+
if (abs >= 1000 || abs < 0.001) {
|
|
13
|
+
const ps1 = value.toExponential();
|
|
14
|
+
const ps2 = value.toExponential(5);
|
|
15
|
+
ps = ps1.length < ps2.length ? ps1 : ps2;
|
|
16
|
+
} else {
|
|
17
|
+
ps = value.toPrecision(6);
|
|
18
|
+
}
|
|
19
|
+
return ps.length < s.length ? ps : s;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** 格式化为 string */
|
|
23
|
+
export function toFormat(value: VmAny, format: string | null | undefined): string {
|
|
24
|
+
const f = format == null ? '' : format.trim();
|
|
25
|
+
|
|
26
|
+
if (typeof value == 'number') {
|
|
27
|
+
if (/^\.\d+$/.test(f)) {
|
|
28
|
+
let digits = Math.trunc(Number(f.slice(1)));
|
|
29
|
+
if (!(digits <= 100)) digits = 100;
|
|
30
|
+
return value.toFixed(digits);
|
|
31
|
+
} else {
|
|
32
|
+
return formatNumber(value);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return toString(value, undefined as never);
|
|
37
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { VmAny } from '../../vm/index.js';
|
|
2
|
+
import { VmError } from '../error.js';
|
|
3
|
+
import { display } from '../serialize.js';
|
|
4
|
+
import { isNaN } from '../utils.js';
|
|
5
|
+
const { POSITIVE_INFINITY, NEGATIVE_INFINITY } = Number;
|
|
6
|
+
|
|
7
|
+
/** 转换为 number */
|
|
8
|
+
export function toNumber<F = undefined>(value: VmAny, fallback?: F): number | Exclude<F, undefined> {
|
|
9
|
+
if (typeof value === 'number') {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
if (typeof value == 'boolean') {
|
|
13
|
+
return value ? 1 : 0;
|
|
14
|
+
}
|
|
15
|
+
if (typeof value == 'string') {
|
|
16
|
+
value = value.trim();
|
|
17
|
+
if (value !== '') {
|
|
18
|
+
if (value === 'inf' || value === '+inf' || value === 'Infinity' || value === '+Infinity') {
|
|
19
|
+
return POSITIVE_INFINITY;
|
|
20
|
+
}
|
|
21
|
+
if (value === '-inf' || value === '-Infinity') {
|
|
22
|
+
return NEGATIVE_INFINITY;
|
|
23
|
+
}
|
|
24
|
+
if (value === 'nan' || value === 'NaN') {
|
|
25
|
+
return Number.NaN;
|
|
26
|
+
}
|
|
27
|
+
const num = Number(value);
|
|
28
|
+
if (!isNaN(num)) return num;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (fallback === undefined) {
|
|
32
|
+
throw new VmError(`Failed to convert value to number: ${display(value)}`, Number.NaN);
|
|
33
|
+
}
|
|
34
|
+
return fallback as Exclude<F, undefined>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { VmAny, VmRecord } from '../../vm/index.js';
|
|
2
|
+
import { isVmArray, isVmWrapper } from '../types.js';
|
|
3
|
+
import { VmError } from '../error.js';
|
|
4
|
+
import { display, displayFunction } from '../serialize.js';
|
|
5
|
+
import { keys, isNaN } from '../utils.js';
|
|
6
|
+
|
|
7
|
+
/** 转换为 string */
|
|
8
|
+
function numberToString(value: number): string {
|
|
9
|
+
if (isNaN(value)) return 'nan';
|
|
10
|
+
if (value === Infinity) return 'inf';
|
|
11
|
+
if (value === -Infinity) return '-inf';
|
|
12
|
+
return String(value);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** 转换为 string */
|
|
16
|
+
export function innerToString(value: VmAny, useBraces: boolean): string {
|
|
17
|
+
if (value == null) return 'nil';
|
|
18
|
+
if (typeof value == 'number') return numberToString(value);
|
|
19
|
+
if (typeof value == 'string' || typeof value == 'boolean') return String(value);
|
|
20
|
+
if (typeof value == 'function') return displayFunction(value);
|
|
21
|
+
if (isVmWrapper(value)) return value.toString(useBraces);
|
|
22
|
+
if (isVmArray(value)) {
|
|
23
|
+
const strings: string[] = [];
|
|
24
|
+
for (const item of value) {
|
|
25
|
+
strings.push(innerToString(item, true));
|
|
26
|
+
}
|
|
27
|
+
// 在 join 过程中会自动把 null/undefined 和 empty slot 转为 ''
|
|
28
|
+
// 与 innerToString 行为不一致
|
|
29
|
+
const results = strings.join(', ');
|
|
30
|
+
if (!useBraces) return results;
|
|
31
|
+
return `[${results}]`;
|
|
32
|
+
} else {
|
|
33
|
+
const entries = keys(value satisfies VmRecord)
|
|
34
|
+
.map((key) => `${key}: ${innerToString(value[key], true)}`)
|
|
35
|
+
.join(', ');
|
|
36
|
+
if (!useBraces) return entries;
|
|
37
|
+
return `(${entries})`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 转换为 string */
|
|
42
|
+
export function toString<F = undefined>(value: VmAny, fallback?: F): string | Exclude<F, undefined> {
|
|
43
|
+
if (typeof value === 'string') return value;
|
|
44
|
+
if (value == null) return '';
|
|
45
|
+
try {
|
|
46
|
+
return innerToString(value, false);
|
|
47
|
+
} catch (ex) {
|
|
48
|
+
if (fallback === undefined) {
|
|
49
|
+
const e = new VmError(`Failed to convert value to string: ${display(value)}`, '');
|
|
50
|
+
e.cause = ex;
|
|
51
|
+
throw e;
|
|
52
|
+
}
|
|
53
|
+
return fallback as Exclude<F, undefined>;
|
|
54
|
+
}
|
|
55
|
+
}
|
package/src/helpers/serialize.ts
CHANGED
package/src/subtle.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getModule } from '@mirascript/bindings';
|
|
2
2
|
|
|
3
3
|
export * as constants from './helpers/constants.js';
|
|
4
|
-
export * as convert from './helpers/convert.js';
|
|
5
|
-
export {
|
|
4
|
+
export * as convert from './helpers/convert/index.js';
|
|
5
|
+
export { DefaultVmContext } from './vm/types/context.js';
|
|
6
6
|
export * as operations from './vm/operations.js';
|
|
7
7
|
export {
|
|
8
8
|
display as serializeForDisplay,
|
package/src/vm/helpers.ts
CHANGED
|
@@ -30,7 +30,7 @@ export const ElementOpt = (key: string, value: VmAny): VmConst => {
|
|
|
30
30
|
return { [key]: value };
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export const Function = (fn: VmFunctionLike, name = VM_FUNCTION_ANONYMOUS_NAME): VmFunction => {
|
|
33
|
+
export const Function = (fn: VmFunctionLike, name: string = VM_FUNCTION_ANONYMOUS_NAME): VmFunction => {
|
|
34
34
|
defineProperty(fn, 'name', { value: name });
|
|
35
35
|
return VmFunction(fn, { isLib: false, injectCp: false });
|
|
36
36
|
};
|