@mirascript/mirascript 0.1.50 → 0.1.51
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-DQKJPXKQ.js → chunk-XVXX5S2W.js} +124 -38
- package/dist/{chunk-DQKJPXKQ.js.map → chunk-XVXX5S2W.js.map} +3 -3
- package/dist/index.js +1 -1
- package/dist/subtle.js +1 -1
- package/dist/vm/lib/global/index.d.ts +1 -1
- package/dist/vm/lib/global/index.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/index.d.ts +1 -0
- package/dist/vm/lib/global/sequence/index.d.ts.map +1 -1
- package/dist/vm/lib/global/sequence/new.d.ts +4 -0
- package/dist/vm/lib/global/sequence/new.d.ts.map +1 -0
- package/dist/vm/lib/global/string/case.d.ts +3 -0
- package/dist/vm/lib/global/string/case.d.ts.map +1 -0
- package/dist/vm/lib/global/string/index.d.ts +8 -0
- package/dist/vm/lib/global/string/index.d.ts.map +1 -0
- package/dist/vm/lib/global/string/search.d.ts +4 -0
- package/dist/vm/lib/global/string/search.d.ts.map +1 -0
- package/dist/vm/lib/global/string/trim.d.ts +4 -0
- package/dist/vm/lib/global/string/trim.d.ts.map +1 -0
- package/dist/vm/operations/type-check.d.ts +2 -2
- package/dist/vm/operations/type-check.d.ts.map +1 -1
- package/dist/vm/types/extern.d.ts +2 -2
- package/dist/vm/types/extern.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/dist/vm/types/module.d.ts +2 -2
- package/dist/vm/types/module.d.ts.map +1 -1
- package/dist/vm/types/wrapper.d.ts +2 -2
- package/dist/vm/types/wrapper.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/vm/lib/global/index.ts +1 -1
- package/src/vm/lib/global/sequence/index.ts +1 -0
- package/src/vm/lib/global/sequence/new.ts +48 -0
- package/src/vm/lib/global/sequence/with.ts +1 -1
- package/src/vm/lib/global/string/case.ts +27 -0
- package/src/vm/lib/global/string/index.ts +65 -0
- package/src/vm/lib/global/string/search.ts +39 -0
- package/src/vm/lib/global/string/trim.ts +40 -0
- package/src/vm/operations/type-check.ts +3 -3
- package/src/vm/types/extern.ts +2 -2
- package/src/vm/types/index.ts +1 -1
- package/src/vm/types/module.ts +2 -2
- package/src/vm/types/wrapper.ts +2 -2
- package/dist/vm/lib/global/string.d.ts +0 -11
- package/dist/vm/lib/global/string.d.ts.map +0 -1
- package/src/vm/lib/global/string.ts +0 -138
package/dist/index.js
CHANGED
package/dist/subtle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vm/lib/global/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { VmArray, VmRecord } from '../../../types/index.js';
|
|
2
|
+
export declare const new_record: ((size: import("../../../types/index.js").VmValue | undefined, generator: import("../../../types/index.js").VmValue | undefined) => VmRecord) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const new_array: ((length: import("../../../types/index.js").VmValue | undefined, generator: import("../../../types/index.js").VmValue | undefined) => VmArray) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
4
|
+
//# sourceMappingURL=new.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/sequence/new.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAW,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAO1E,eAAO,MAAM,UAAU,sIACA,QAAQ,iEAoB9B,CAAC;AAEF,eAAO,MAAM,SAAS,wIACG,OAAO,iEAgB/B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const to_uppercase: ((str: import("../../../index.js").VmValue | undefined) => string) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
2
|
+
export declare const to_lowercase: ((str: import("../../../index.js").VmValue | undefined) => string) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
//# sourceMappingURL=case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/string/case.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,oIAWxB,CAAC;AAEF,eAAO,MAAM,YAAY,oIAWxB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './trim.js';
|
|
2
|
+
export * from './case.js';
|
|
3
|
+
export * from './search.js';
|
|
4
|
+
export declare const chars: ((str: import("../../../index.js").VmValue | undefined) => string[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
5
|
+
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>;
|
|
6
|
+
export declare const split: ((str: import("../../../index.js").VmValue | undefined, separator?: import("../../../index.js").VmValue | undefined) => string[]) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
7
|
+
export declare const join: ((arr: import("../../../index.js").VmValue | undefined, separator?: import("../../../index.js").VmValue | undefined) => string) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/string/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAE5B,eAAO,MAAM,KAAK,sIAWjB,CAAC;AAEF,eAAO,MAAM,OAAO,4PAcnB,CAAC;AAEF,eAAO,MAAM,KAAK,mMAcjB,CAAC;AAEF,eAAO,MAAM,IAAI,iMAahB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
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>;
|
|
2
|
+
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>;
|
|
3
|
+
export declare const contains: ((str: import("../../../index.js").VmValue | undefined, search: import("../../../index.js").VmValue | undefined) => boolean) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
4
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/string/search.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,8LAWvB,CAAC;AACF,eAAO,MAAM,SAAS,8LAWrB,CAAC;AAEF,eAAO,MAAM,QAAQ,8LAWpB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const trim_start: ((str: import("../../../index.js").VmValue | undefined) => string) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
2
|
+
export declare const trim_end: ((str: import("../../../index.js").VmValue | undefined) => string) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
3
|
+
export declare const trim: ((str: import("../../../index.js").VmValue | undefined) => string) & import("../../helpers.js").VmLibOption & Record<never, never>;
|
|
4
|
+
//# sourceMappingURL=trim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../../../../src/vm/lib/global/string/trim.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,oIAWtB,CAAC;AAEF,eAAO,MAAM,QAAQ,oIAWpB,CAAC;AAEF,eAAO,MAAM,IAAI,oIAWhB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VmTypeName, VmAny, VmArray, VmRecord, VmValue } from '../types/index.js';
|
|
2
2
|
/** 获取值的类型名称 */
|
|
3
|
-
export declare function $Type(value: VmAny):
|
|
3
|
+
export declare function $Type(value: VmAny): VmTypeName;
|
|
4
4
|
/** 判断值是否为布尔值 */
|
|
5
5
|
export declare function $IsBoolean(value: VmAny): value is boolean;
|
|
6
6
|
/** 判断值是否为数字 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-check.d.ts","sourceRoot":"","sources":["../../../src/vm/operations/type-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"type-check.d.ts","sourceRoot":"","sources":["../../../src/vm/operations/type-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGvF,eAAe;AACf,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAO9C;AACD,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,OAAO,CAGzD;AACD,eAAe;AACf,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,MAAM,CAGvD;AACD,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,MAAM,CAGvD;AACD,eAAe;AACf,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,QAAQ,CAGzD;AACD,eAAe;AACf,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,OAAO,CAGvD;AACD,eAAe;AACf,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAItG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VmTypeName, VmAny, VmConst, VmPrimitive, VmValue } from './index.js';
|
|
2
2
|
import { VmWrapper } from './wrapper.js';
|
|
3
3
|
/** 包装 Mirascript `extern` 类型的对象 */
|
|
4
4
|
export declare class VmExtern<const T extends object = object> extends VmWrapper<T> {
|
|
@@ -37,7 +37,7 @@ export declare class VmExtern<const T extends object = object> extends VmWrapper
|
|
|
37
37
|
/** @inheritdoc */
|
|
38
38
|
toString(useBraces: boolean): string;
|
|
39
39
|
/** @inheritdoc */
|
|
40
|
-
get type():
|
|
40
|
+
get type(): VmTypeName;
|
|
41
41
|
/** @inheritdoc */
|
|
42
42
|
get tag(): string;
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extern.d.ts","sourceRoot":"","sources":["../../../src/vm/types/extern.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"extern.d.ts","sourceRoot":"","sources":["../../../src/vm/types/extern.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA4BzC,mCAAmC;AACnC,qBAAa,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAInE,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI;;IAH7C,UAAU;IACV,KAAK,EAAE,CAAC;IACR,uCAAuC;IAC9B,OAAO,GAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAW;IAKxD;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO;IAiBrD,kBAAkB;IAClB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC;IAI9F,kBAAkB;IACT,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAGlC,kBAAkB;IACT,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IAMhC,mCAAmC;IACnC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO;IAMzC,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,KAAK;IAerC,kBAAkB;IACT,IAAI,CAAC,oBAAoB,UAAQ,GAAG,MAAM,EAAE;IAmBrD,kBAAkB;IACT,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAIpC;;;;OAIG;IACH,WAAW,IAAI,IAAI,IAAI,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAGnD,kBAAkB;IACT,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM;IAoB7C,kBAAkB;IAClB,IAAa,IAAI,IAAI,UAAU,CAE9B;IACD,kBAAkB;IAClB,IAAa,GAAG,IAAI,MAAM,CA6BzB;CACJ"}
|
package/dist/vm/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { VmExtern } from './extern.js';
|
|
|
2
2
|
import type { VmFunction } from './function.js';
|
|
3
3
|
import type { VmModule } from './module.js';
|
|
4
4
|
/** 类型名称 */
|
|
5
|
-
export type
|
|
5
|
+
export type VmTypeName = keyof VmValueMap;
|
|
6
6
|
/** Mirascript 虚拟机内的未初始化变量 */
|
|
7
7
|
export type VmUninitialized = undefined;
|
|
8
8
|
/** Mirascript 原始值 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vm/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,WAAW;AACX,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vm/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,WAAW;AACX,MAAM,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC;AAE1C,6BAA6B;AAC7B,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AACxC,qBAAqB;AACrB,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC3D;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;AACzD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC/C,CAAC;AACF,2BAA2B;AAC3B,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AACvD,2BAA2B;AAC3B,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAC1D,0BAA0B;AAC1B,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC7C,kCAAkC;AAClC,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,eAAe,CAAC;AAE9C,aAAa;AACb,MAAM,WAAW,UAAU;IACvB,SAAS;IACT,GAAG,EAAE,IAAI,CAAC;IACV,UAAU;IACV,MAAM,EAAE,MAAM,CAAC;IACf,SAAS;IACT,MAAM,EAAE,MAAM,CAAC;IACf,UAAU;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB;IACpB,MAAM,EAAE,QAAQ,CAAC;IACjB,oBAAoB;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,oBAAoB;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,aAAa;IACb,MAAM,EAAE,QAAQ,CAAC;IACjB,oBAAoB;IACpB,MAAM,EAAE,QAAQ,CAAC;CACpB;AAED,OAAO,EACH,OAAO,EACP,SAAS,EACT,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VmTypeName, VmAny, VmImmutable } from './index.js';
|
|
2
2
|
import { VmWrapper } from './wrapper.js';
|
|
3
3
|
/** Mirascript 模块 */
|
|
4
4
|
export declare class VmModule<const T extends Record<string, VmImmutable> = Record<string, VmImmutable>> extends VmWrapper<T> {
|
|
@@ -18,7 +18,7 @@ export declare class VmModule<const T extends Record<string, VmImmutable> = Reco
|
|
|
18
18
|
/** @inheritdoc */
|
|
19
19
|
same(other: VmAny): boolean;
|
|
20
20
|
/** @inheritdoc */
|
|
21
|
-
get type():
|
|
21
|
+
get type(): VmTypeName;
|
|
22
22
|
/** @inheritdoc */
|
|
23
23
|
get tag(): string;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/vm/types/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/vm/types/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,oBAAoB;AACpB,qBAAa,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAE7G,WAAW;IACX,QAAQ,CAAC,IAAI,EAAE,MAAM;;IADrB,WAAW;IACF,IAAI,EAAE,MAAM;IACrB,WAAW;IACX,KAAK,EAAE,CAAC;IAIZ,kBAAkB;IACT,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAGlC,kBAAkB;IACT,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IAIhC,kBAAkB;IACT,IAAI,IAAI,MAAM,EAAE;IAGzB,kBAAkB;IACT,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAGpC,kBAAkB;IAClB,IAAa,IAAI,IAAI,UAAU,CAE9B;IACD,kBAAkB;IAClB,IAAa,GAAG,IAAI,MAAM,CAEzB;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VmTypeName, VmAny } from './index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Mirascript 特殊值的包装器
|
|
4
4
|
*/
|
|
@@ -14,7 +14,7 @@ export declare abstract class VmWrapper<T extends object> {
|
|
|
14
14
|
/** 与其他值比较 */
|
|
15
15
|
abstract same(other: VmAny): boolean;
|
|
16
16
|
/** 获取类型 */
|
|
17
|
-
abstract get type():
|
|
17
|
+
abstract get type(): VmTypeName;
|
|
18
18
|
/** 获取当前对象的描述 */
|
|
19
19
|
abstract get tag(): string;
|
|
20
20
|
/** 描述键对应的值 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../src/vm/types/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../src/vm/types/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,8BAAsB,SAAS,CAAC,CAAC,SAAS,MAAM;IAChC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAAR,KAAK,EAAE,CAAC;IAC7B,cAAc;IACd,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAClC,cAAc;IACd,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IAChC,WAAW;IACX,QAAQ,CAAC,IAAI,IAAI,MAAM,EAAE;IACzB,aAAa;IACb,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IACpC,WAAW;IACX,QAAQ,KAAK,IAAI,IAAI,UAAU,CAAC;IAChC,gBAAgB;IAChB,QAAQ,KAAK,GAAG,IAAI,MAAM,CAAC;IAC3B,cAAc;IACd,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAGzC,YAAY;IACZ,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM;CAKvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirascript/mirascript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"author": "CloudPSS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "An expression based scripting language.",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"@cloudpss/worker": "^0.1.10",
|
|
30
30
|
"source-map-js": "^1.2.1",
|
|
31
31
|
"supports-color": "^10.2.2",
|
|
32
|
-
"@mirascript/bindings": "~0.1.
|
|
33
|
-
"@mirascript/constants": "~0.1.
|
|
32
|
+
"@mirascript/bindings": "~0.1.51",
|
|
33
|
+
"@mirascript/constants": "~0.1.51"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^25.3.
|
|
37
|
-
"ava": "^
|
|
36
|
+
"@types/node": "^25.3.3",
|
|
37
|
+
"ava": "^7.0.0",
|
|
38
38
|
"c8": "^11.0.0",
|
|
39
39
|
"tinybench": "^6.0.0",
|
|
40
40
|
"type-fest": "^5.4.4"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { VmArray, VmConst, VmRecord } from '../../../types/index.js';
|
|
2
|
+
import { toString } from '../../../../helpers/convert/to-string.js';
|
|
3
|
+
import { VM_ARRAY_MAX_LENGTH } from '../../../../helpers/constants.js';
|
|
4
|
+
import { keys as _keys, values as _values, entries as _entries, PositiveInfinity } from '../../../../helpers/utils.js';
|
|
5
|
+
import { $Call, $El, $Get } from '../../../operations/index.js';
|
|
6
|
+
import { VmLib, expectCallable, expectIntegerRange } from '../../helpers.js';
|
|
7
|
+
|
|
8
|
+
export const new_record = VmLib(
|
|
9
|
+
(size, generator): VmRecord => {
|
|
10
|
+
const n = expectIntegerRange('size', size, 0, PositiveInfinity);
|
|
11
|
+
expectCallable('generator', generator, null);
|
|
12
|
+
const result: Record<string, VmConst> = {};
|
|
13
|
+
for (let i = 0; i < n; i++) {
|
|
14
|
+
const entry = $Call(generator, [i]) as VmArray;
|
|
15
|
+
if (entry == null) continue;
|
|
16
|
+
const key = $Get(entry, 0);
|
|
17
|
+
const value = $El($Get(entry, 1));
|
|
18
|
+
result[toString(key)] = value;
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
summary: '根据生成器函数创建一个记录',
|
|
24
|
+
params: { size: '记录的大小', generator: '生成器函数,返回键值对或 nil(表示跳过该条目)' },
|
|
25
|
+
paramsType: { size: 'number', generator: 'fn(index: number) -> (string, any) | nil' },
|
|
26
|
+
returnsType: 'record',
|
|
27
|
+
examples: ['new_record(3, fn { (it, it * 2) }) // (0, 2, 4)'],
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const new_array = VmLib(
|
|
32
|
+
(length, generator): VmArray => {
|
|
33
|
+
const n = expectIntegerRange('length', length, 0, VM_ARRAY_MAX_LENGTH);
|
|
34
|
+
expectCallable('generator', generator, null);
|
|
35
|
+
const result: VmConst[] = [];
|
|
36
|
+
for (let i = 0; i < n; i++) {
|
|
37
|
+
result.push($El($Call(generator, [i])));
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
summary: '根据生成器函数创建一个数组',
|
|
43
|
+
params: { length: '数组的长度', generator: '生成器函数,返回数组元素的值' },
|
|
44
|
+
paramsType: { length: 'number', generator: 'fn(index: number) -> any' },
|
|
45
|
+
returnsType: 'array',
|
|
46
|
+
examples: ['new_array(5, fn { it * it }) // [0, 1, 4, 9, 16]'],
|
|
47
|
+
},
|
|
48
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { expectString, VmLib } from '../../helpers.js';
|
|
2
|
+
|
|
3
|
+
export const to_uppercase = VmLib(
|
|
4
|
+
(str) => {
|
|
5
|
+
return expectString('str', str).toUpperCase();
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
summary: '将字符串转换为大写',
|
|
9
|
+
params: { str: '要转换的字符串' },
|
|
10
|
+
paramsType: { str: 'string' },
|
|
11
|
+
returnsType: 'string',
|
|
12
|
+
examples: ['to_uppercase("mira") // "MIRA"'],
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const to_lowercase = VmLib(
|
|
17
|
+
(str) => {
|
|
18
|
+
return expectString('str', str).toLowerCase();
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
summary: '将字符串转换为小写',
|
|
22
|
+
params: { str: '要转换的字符串' },
|
|
23
|
+
paramsType: { str: 'string' },
|
|
24
|
+
returnsType: 'string',
|
|
25
|
+
examples: ['to_lowercase("MIRA") // "mira"'],
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { expectArray, expectString, VmLib } from '../../helpers.js';
|
|
2
|
+
|
|
3
|
+
export * from './trim.js';
|
|
4
|
+
export * from './case.js';
|
|
5
|
+
export * from './search.js';
|
|
6
|
+
|
|
7
|
+
export const chars = VmLib(
|
|
8
|
+
(str) => {
|
|
9
|
+
return Array.from(expectString('str', str));
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
summary: '将字符串转换为字符数组',
|
|
13
|
+
params: { str: '要转换的字符串' },
|
|
14
|
+
paramsType: { str: 'string' },
|
|
15
|
+
returnsType: 'string[]',
|
|
16
|
+
examples: ['chars("Mira") // ["M", "i", "r", "a"]'],
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const replace = VmLib(
|
|
21
|
+
(str, search, replacement = '') => {
|
|
22
|
+
return expectString('str', str).replaceAll(
|
|
23
|
+
expectString('search', search),
|
|
24
|
+
expectString('replacement', replacement),
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
summary: '替换字符串中的指定子串',
|
|
29
|
+
params: { str: '要处理的字符串', search: '要替换的子串', replacement: '替换后的字符串' },
|
|
30
|
+
paramsType: { str: 'string', search: 'string', replacement: 'string' },
|
|
31
|
+
returnsType: 'string',
|
|
32
|
+
examples: ['replace("foo bar foo", "foo", "baz") // "baz bar baz"'],
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const split = VmLib(
|
|
37
|
+
(str, separator = '') => {
|
|
38
|
+
const s = expectString('str', str);
|
|
39
|
+
const p = expectString('separator', separator);
|
|
40
|
+
if (!p) return [...s];
|
|
41
|
+
return s.split(p);
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
summary: '将字符串拆分为子串数组',
|
|
45
|
+
params: { str: '要拆分的字符串', separator: '分隔符' },
|
|
46
|
+
paramsType: { str: 'string', separator: 'string' },
|
|
47
|
+
returnsType: 'string[]',
|
|
48
|
+
examples: ['split("a,b,c", ",") // ["a", "b", "c"]'],
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export const join = VmLib(
|
|
53
|
+
(arr, separator = '') => {
|
|
54
|
+
expectArray('arr', arr, null);
|
|
55
|
+
const s = expectString('separator', separator);
|
|
56
|
+
return arr.map((v) => expectString(null, v)).join(s);
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
summary: '将字符串数组连接为单个字符串',
|
|
60
|
+
params: { arr: '要连接的字符串数组', separator: '分隔符' },
|
|
61
|
+
paramsType: { arr: 'string[]', separator: 'string' },
|
|
62
|
+
returnsType: 'string',
|
|
63
|
+
examples: ['join(["a", "b", "c"], "-") // "a-b-c"'],
|
|
64
|
+
},
|
|
65
|
+
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { expectString, VmLib } from '../../helpers.js';
|
|
2
|
+
|
|
3
|
+
export const starts_with = VmLib(
|
|
4
|
+
(str, search) => {
|
|
5
|
+
return expectString('str', str).startsWith(expectString('search', search));
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
summary: '检查字符串是否以指定子串开头',
|
|
9
|
+
params: { str: '要检查的字符串', search: '要匹配的子串' },
|
|
10
|
+
paramsType: { str: 'string', search: 'string' },
|
|
11
|
+
returnsType: 'boolean',
|
|
12
|
+
examples: ['starts_with("mira", "mi") // true'],
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
export const ends_with = VmLib(
|
|
16
|
+
(str, search) => {
|
|
17
|
+
return expectString('str', str).endsWith(expectString('search', search));
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
summary: '检查字符串是否以指定子串结尾',
|
|
21
|
+
params: { str: '要检查的字符串', search: '要匹配的子串' },
|
|
22
|
+
paramsType: { str: 'string', search: 'string' },
|
|
23
|
+
returnsType: 'boolean',
|
|
24
|
+
examples: ['ends_with("mira", "ra") // true'],
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const contains = VmLib(
|
|
29
|
+
(str, search) => {
|
|
30
|
+
return expectString('str', str).includes(expectString('search', search));
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
summary: '检查字符串是否包含指定子串',
|
|
34
|
+
params: { str: '要检查的字符串', search: '要匹配的子串' },
|
|
35
|
+
paramsType: { str: 'string', search: 'string' },
|
|
36
|
+
returnsType: 'boolean',
|
|
37
|
+
examples: ['contains("hello", "ll") // true'],
|
|
38
|
+
},
|
|
39
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { expectString, VmLib } from '../../helpers.js';
|
|
2
|
+
|
|
3
|
+
export const trim_start = VmLib(
|
|
4
|
+
(str) => {
|
|
5
|
+
return expectString('str', str).trimStart();
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
summary: '去除字符串开头的空白字符',
|
|
9
|
+
params: { str: '要处理的字符串' },
|
|
10
|
+
paramsType: { str: 'string' },
|
|
11
|
+
returnsType: 'string',
|
|
12
|
+
examples: ['trim_start(" mira") // "mira"'],
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const trim_end = VmLib(
|
|
17
|
+
(str) => {
|
|
18
|
+
return expectString('str', str).trimEnd();
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
summary: '去除字符串结尾的空白字符',
|
|
22
|
+
params: { str: '要处理的字符串' },
|
|
23
|
+
paramsType: { str: 'string' },
|
|
24
|
+
returnsType: 'string',
|
|
25
|
+
examples: ['trim_end("mira ") // "mira"'],
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const trim = VmLib(
|
|
30
|
+
(str) => {
|
|
31
|
+
return expectString('str', str).trim();
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
summary: '去除字符串两端的空白字符',
|
|
35
|
+
params: { str: '要处理的字符串' },
|
|
36
|
+
paramsType: { str: 'string' },
|
|
37
|
+
returnsType: 'string',
|
|
38
|
+
examples: ['trim(" mira ") // "mira"'],
|
|
39
|
+
},
|
|
40
|
+
);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { VmError } from '../../helpers/error.js';
|
|
2
2
|
import { isVmArray, isVmRecord, isVmWrapper } from '../../helpers/types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { VmTypeName, VmAny, VmArray, VmRecord, VmValue } from '../types/index.js';
|
|
4
4
|
import { $AssertInit } from './common.js';
|
|
5
5
|
|
|
6
6
|
/** 获取值的类型名称 */
|
|
7
|
-
export function $Type(value: VmAny):
|
|
7
|
+
export function $Type(value: VmAny): VmTypeName {
|
|
8
8
|
// 允许未初始化值通过
|
|
9
9
|
if (value == null) return 'nil';
|
|
10
10
|
if (isVmWrapper(value)) return value.type;
|
|
11
11
|
if (isVmArray(value)) return 'array';
|
|
12
12
|
if (typeof value == 'object') return 'record';
|
|
13
|
-
return typeof value as
|
|
13
|
+
return typeof value as VmTypeName;
|
|
14
14
|
}
|
|
15
15
|
/** 判断值是否为布尔值 */
|
|
16
16
|
export function $IsBoolean(value: VmAny): value is boolean {
|
package/src/vm/types/extern.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { getPrototypeOf, getOwnPropertyNames, hasOwn, apply, isArray } from '../
|
|
|
3
3
|
import { innerToString } from '../../helpers/convert/to-string.js';
|
|
4
4
|
import { isVmExtern } from '../../helpers/types.js';
|
|
5
5
|
import { kVmExtern } from '../../helpers/constants.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { VmTypeName, VmAny, VmConst, VmPrimitive, VmValue } from './index.js';
|
|
7
7
|
import { VmWrapper } from './wrapper.js';
|
|
8
8
|
import { unwrapFromVmValue, wrapToVmValue } from './boundary.js';
|
|
9
9
|
|
|
@@ -158,7 +158,7 @@ export class VmExtern<const T extends object = object> extends VmWrapper<T> {
|
|
|
158
158
|
return String(this.value);
|
|
159
159
|
}
|
|
160
160
|
/** @inheritdoc */
|
|
161
|
-
override get type():
|
|
161
|
+
override get type(): VmTypeName {
|
|
162
162
|
return 'extern';
|
|
163
163
|
}
|
|
164
164
|
/** @inheritdoc */
|
package/src/vm/types/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { VmFunction } from './function.js';
|
|
|
3
3
|
import type { VmModule } from './module.js';
|
|
4
4
|
|
|
5
5
|
/** 类型名称 */
|
|
6
|
-
export type
|
|
6
|
+
export type VmTypeName = keyof VmValueMap;
|
|
7
7
|
|
|
8
8
|
/** Mirascript 虚拟机内的未初始化变量 */
|
|
9
9
|
export type VmUninitialized = undefined;
|
package/src/vm/types/module.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { kVmModule } from '../../helpers/constants.js';
|
|
2
2
|
import { hasOwnEnumerable, keys } from '../../helpers/utils.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { VmTypeName, VmAny, VmImmutable } from './index.js';
|
|
4
4
|
import { VmWrapper } from './wrapper.js';
|
|
5
5
|
|
|
6
6
|
/** Mirascript 模块 */
|
|
@@ -31,7 +31,7 @@ export class VmModule<const T extends Record<string, VmImmutable> = Record<strin
|
|
|
31
31
|
return this === other;
|
|
32
32
|
}
|
|
33
33
|
/** @inheritdoc */
|
|
34
|
-
override get type():
|
|
34
|
+
override get type(): VmTypeName {
|
|
35
35
|
return 'module';
|
|
36
36
|
}
|
|
37
37
|
/** @inheritdoc */
|
package/src/vm/types/wrapper.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { kVmWrapper } from '../../helpers/constants.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VmTypeName, VmAny } from './index.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Mirascript 特殊值的包装器
|
|
@@ -15,7 +15,7 @@ export abstract class VmWrapper<T extends object> {
|
|
|
15
15
|
/** 与其他值比较 */
|
|
16
16
|
abstract same(other: VmAny): boolean;
|
|
17
17
|
/** 获取类型 */
|
|
18
|
-
abstract get type():
|
|
18
|
+
abstract get type(): VmTypeName;
|
|
19
19
|
/** 获取当前对象的描述 */
|
|
20
20
|
abstract get tag(): string;
|
|
21
21
|
/** 描述键对应的值 */
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=string.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|