@jplorg/jpl 2.0.0 → 2.1.0
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/esm/main.js +3474 -0
- package/dist/types/applyDefaults.d.ts +2 -0
- package/dist/types/builtins/funcContains.d.ts +3 -0
- package/dist/types/builtins/funcEndsWith.d.ts +3 -0
- package/dist/types/builtins/funcError.d.ts +3 -0
- package/dist/types/builtins/funcFromJSON.d.ts +3 -0
- package/dist/types/builtins/funcHas.d.ts +3 -0
- package/dist/types/builtins/funcIn.d.ts +3 -0
- package/dist/types/builtins/funcKeys.d.ts +3 -0
- package/dist/types/builtins/funcLength.d.ts +3 -0
- package/dist/types/builtins/funcNow.d.ts +3 -0
- package/dist/types/builtins/funcStartsWith.d.ts +3 -0
- package/dist/types/builtins/funcToJSON.d.ts +3 -0
- package/dist/types/builtins/funcToLowerCase.d.ts +3 -0
- package/dist/types/builtins/funcToNumber.d.ts +3 -0
- package/dist/types/builtins/funcToString.d.ts +3 -0
- package/dist/types/builtins/funcToUpperCase.d.ts +3 -0
- package/dist/types/builtins/funcTrim.d.ts +3 -0
- package/dist/types/builtins/funcTrimEnd.d.ts +3 -0
- package/dist/types/builtins/funcTrimStart.d.ts +3 -0
- package/dist/types/builtins/funcType.d.ts +3 -0
- package/dist/types/builtins/funcVoid.d.ts +3 -0
- package/dist/types/builtins/index.d.ts +2 -0
- package/dist/types/builtins/internals.d.ts +1 -0
- package/dist/types/builtins/math.d.ts +17 -0
- package/dist/types/createSingleton.d.ts +1 -0
- package/dist/types/interpreter/index.d.ts +21 -0
- package/dist/types/interpreter/parse.d.ts +194 -0
- package/{src/interpreter/parseFunction.js → dist/types/interpreter/parseFunction.d.ts} +2 -10
- package/dist/types/interpreter/system.d.ts +3 -0
- package/dist/types/interpreter/util.d.ts +89 -0
- package/dist/types/library/apply.d.ts +32 -0
- package/dist/types/library/definition.d.ts +79 -0
- package/dist/types/library/errors/adaptErrors.d.ts +6 -0
- package/dist/types/library/errors/enclosure.d.ts +6 -0
- package/dist/types/library/errors/error.d.ts +6 -0
- package/dist/types/library/errors/execution.d.ts +12 -0
- package/dist/types/library/errors/fatal.d.ts +4 -0
- package/dist/types/library/errors/runtime.d.ts +46 -0
- package/dist/types/library/errors/syntax.d.ts +7 -0
- package/{src/library/functions.js → dist/types/library/functions.d.ts} +9 -30
- package/dist/types/library/index.d.ts +18 -0
- package/dist/types/library/mux.d.ts +19 -0
- package/{src/library/ops/op.js → dist/types/library/ops/op.d.ts} +25 -49
- package/{src/library/ops/opa.js → dist/types/library/ops/opa.d.ts} +4 -7
- package/{src/library/ops/opc.js → dist/types/library/ops/opc.d.ts} +6 -11
- package/{src/library/ops/opm.js → dist/types/library/ops/opm.d.ts} +5 -9
- package/{src/library/ops/opu.js → dist/types/library/ops/opu.d.ts} +8 -15
- package/dist/types/library/runtimeScope.d.ts +23 -0
- package/dist/types/library/runtimeSignal.d.ts +25 -0
- package/dist/types/library/types.d.ts +97 -0
- package/dist/types/main.d.ts +19 -0
- package/dist/types/program/handler.d.ts +12 -0
- package/dist/types/program/index.d.ts +40 -0
- package/dist/types/program/ops/index.d.ts +5 -0
- package/dist/types/program/ops/opAccess/index.d.ts +11 -0
- package/dist/types/program/ops/opAccess/opaField.d.ts +11 -0
- package/dist/types/program/ops/opAccess/opaFunction.d.ts +11 -0
- package/dist/types/program/ops/opAccess/opaIter.d.ts +11 -0
- package/dist/types/program/ops/opAccess/opaSlice.d.ts +11 -0
- package/dist/types/program/ops/opAnd.d.ts +11 -0
- package/dist/types/program/ops/opArrayConstructor.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/index.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opaAssignField.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opaAssignIter.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opaAssignSlice.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuAddition.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuDivision.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuMultiplication.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuNullCoalescence.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuRemainder.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuSet.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuSubtraction.d.ts +11 -0
- package/dist/types/program/ops/opAssignment/opuUpdate.d.ts +11 -0
- package/dist/types/program/ops/opCalculation/index.d.ts +11 -0
- package/dist/types/program/ops/opCalculation/opmAddition.d.ts +11 -0
- package/dist/types/program/ops/opCalculation/opmDivision.d.ts +11 -0
- package/dist/types/program/ops/opCalculation/opmMultiplication.d.ts +11 -0
- package/dist/types/program/ops/opCalculation/opmRemainder.d.ts +11 -0
- package/dist/types/program/ops/opCalculation/opmSubtraction.d.ts +11 -0
- package/dist/types/program/ops/opComparison/index.d.ts +11 -0
- package/dist/types/program/ops/opComparison/opcEqual.d.ts +11 -0
- package/dist/types/program/ops/opComparison/opcGreater.d.ts +11 -0
- package/dist/types/program/ops/opComparison/opcGreaterEqual.d.ts +11 -0
- package/dist/types/program/ops/opComparison/opcLess.d.ts +11 -0
- package/dist/types/program/ops/opComparison/opcLessEqual.d.ts +11 -0
- package/dist/types/program/ops/opComparison/opcUnequal.d.ts +11 -0
- package/dist/types/program/ops/opConstant.d.ts +11 -0
- package/dist/types/program/ops/opConstantFalse.d.ts +11 -0
- package/dist/types/program/ops/opConstantNull.d.ts +11 -0
- package/dist/types/program/ops/opConstantTrue.d.ts +11 -0
- package/dist/types/program/ops/opFunctionDefinition.d.ts +11 -0
- package/dist/types/program/ops/opIf.d.ts +11 -0
- package/dist/types/program/ops/opInterpolatedString.d.ts +11 -0
- package/dist/types/program/ops/opNegation.d.ts +11 -0
- package/dist/types/program/ops/opNot.d.ts +11 -0
- package/dist/types/program/ops/opNullCoalescence.d.ts +11 -0
- package/dist/types/program/ops/opNumber.d.ts +11 -0
- package/dist/types/program/ops/opObjectConstructor.d.ts +11 -0
- package/dist/types/program/ops/opOr.d.ts +11 -0
- package/dist/types/program/ops/opOutputConcat.d.ts +11 -0
- package/dist/types/program/ops/opString.d.ts +11 -0
- package/dist/types/program/ops/opTry.d.ts +11 -0
- package/dist/types/program/ops/opVariable.d.ts +11 -0
- package/dist/types/program/ops/opVariableDefinition.d.ts +11 -0
- package/dist/types/program/ops/opVoid.d.ts +11 -0
- package/dist/types/program/ops/utils.d.ts +5 -0
- package/dist/types/program/params.d.ts +68 -0
- package/dist/types/runtime/index.d.ts +83 -0
- package/package.json +66 -49
- package/{repl.js → repl.ts} +85 -39
- package/lib/applyDefaults.js +0 -34
- package/lib/builtins/funcContains.js +0 -25
- package/lib/builtins/funcEndsWith.js +0 -21
- package/lib/builtins/funcError.js +0 -11
- package/lib/builtins/funcFromJSON.js +0 -26
- package/lib/builtins/funcHas.js +0 -24
- package/lib/builtins/funcIn.js +0 -24
- package/lib/builtins/funcKeys.js +0 -20
- package/lib/builtins/funcLength.js +0 -24
- package/lib/builtins/funcNow.js +0 -10
- package/lib/builtins/funcStartsWith.js +0 -21
- package/lib/builtins/funcToJSON.js +0 -10
- package/lib/builtins/funcToLowerCase.js +0 -17
- package/lib/builtins/funcToNumber.js +0 -26
- package/lib/builtins/funcToString.js +0 -10
- package/lib/builtins/funcToUpperCase.js +0 -17
- package/lib/builtins/funcTrim.js +0 -17
- package/lib/builtins/funcTrimEnd.js +0 -17
- package/lib/builtins/funcTrimStart.js +0 -17
- package/lib/builtins/funcType.js +0 -10
- package/lib/builtins/funcVoid.js +0 -10
- package/lib/builtins/index.js +0 -205
- package/lib/builtins/internals.js +0 -8
- package/lib/builtins/math.js +0 -40
- package/lib/builtins/native.js +0 -180
- package/lib/createSingleton.js +0 -14
- package/lib/index.js +0 -79
- package/lib/interpreter/index.js +0 -56
- package/lib/interpreter/parse.js +0 -2377
- package/lib/interpreter/parseFunction.js +0 -24
- package/lib/interpreter/system.js +0 -10
- package/lib/interpreter/util.js +0 -349
- package/lib/library/apply.js +0 -142
- package/lib/library/definition.js +0 -9
- package/lib/library/errors/adaptErrors.js +0 -34
- package/lib/library/errors/enclosure.js +0 -16
- package/lib/library/errors/error.js +0 -18
- package/lib/library/errors/execution.js +0 -20
- package/lib/library/errors/fatal.js +0 -15
- package/lib/library/errors/runtime.js +0 -78
- package/lib/library/errors/syntax.js +0 -17
- package/lib/library/functions.js +0 -82
- package/lib/library/index.js +0 -335
- package/lib/library/mux.js +0 -106
- package/lib/library/ops/index.js +0 -60
- package/lib/library/ops/op.js +0 -180
- package/lib/library/ops/opa.js +0 -41
- package/lib/library/ops/opc.js +0 -59
- package/lib/library/ops/opm.js +0 -50
- package/lib/library/ops/opu.js +0 -77
- package/lib/library/runtimeScope.js +0 -38
- package/lib/library/runtimeSignal.js +0 -72
- package/lib/library/types.js +0 -304
- package/lib/program/index.js +0 -101
- package/lib/program/ops/index.js +0 -61
- package/lib/program/ops/opAccess/index.js +0 -55
- package/lib/program/ops/opAccess/opaField.js +0 -50
- package/lib/program/ops/opAccess/opaFunction.js +0 -50
- package/lib/program/ops/opAccess/opaIter.js +0 -33
- package/lib/program/ops/opAccess/opaSlice.js +0 -46
- package/lib/program/ops/opAnd.js +0 -30
- package/lib/program/ops/opArrayConstructor.js +0 -20
- package/lib/program/ops/opAssignment/index.js +0 -90
- package/lib/program/ops/opAssignment/opaAssignField.js +0 -125
- package/lib/program/ops/opAssignment/opaAssignIter.js +0 -71
- package/lib/program/ops/opAssignment/opaAssignSlice.js +0 -101
- package/lib/program/ops/opAssignment/opuAddition.js +0 -31
- package/lib/program/ops/opAssignment/opuDivision.js +0 -31
- package/lib/program/ops/opAssignment/opuMultiplication.js +0 -31
- package/lib/program/ops/opAssignment/opuNullCoalescence.js +0 -25
- package/lib/program/ops/opAssignment/opuRemainder.js +0 -31
- package/lib/program/ops/opAssignment/opuSet.js +0 -19
- package/lib/program/ops/opAssignment/opuSubtraction.js +0 -31
- package/lib/program/ops/opAssignment/opuUpdate.js +0 -19
- package/lib/program/ops/opCalculation/index.js +0 -57
- package/lib/program/ops/opCalculation/opmAddition.js +0 -49
- package/lib/program/ops/opCalculation/opmDivision.js +0 -42
- package/lib/program/ops/opCalculation/opmMultiplication.js +0 -40
- package/lib/program/ops/opCalculation/opmRemainder.js +0 -34
- package/lib/program/ops/opCalculation/opmSubtraction.js +0 -53
- package/lib/program/ops/opComparison/index.js +0 -59
- package/lib/program/ops/opComparison/opcEqual.js +0 -19
- package/lib/program/ops/opComparison/opcGreater.js +0 -19
- package/lib/program/ops/opComparison/opcGreaterEqual.js +0 -19
- package/lib/program/ops/opComparison/opcLess.js +0 -19
- package/lib/program/ops/opComparison/opcLessEqual.js +0 -19
- package/lib/program/ops/opComparison/opcUnequal.js +0 -19
- package/lib/program/ops/opConstant.js +0 -18
- package/lib/program/ops/opConstantFalse.js +0 -16
- package/lib/program/ops/opConstantNull.js +0 -16
- package/lib/program/ops/opConstantTrue.js +0 -16
- package/lib/program/ops/opFunctionDefinition.js +0 -21
- package/lib/program/ops/opIf.js +0 -38
- package/lib/program/ops/opInterpolatedString.js +0 -24
- package/lib/program/ops/opNegation.js +0 -25
- package/lib/program/ops/opNot.js +0 -16
- package/lib/program/ops/opNullCoalescence.js +0 -34
- package/lib/program/ops/opNumber.js +0 -18
- package/lib/program/ops/opObjectConstructor.js +0 -37
- package/lib/program/ops/opOr.js +0 -30
- package/lib/program/ops/opOutputConcat.js +0 -19
- package/lib/program/ops/opString.js +0 -18
- package/lib/program/ops/opTry.js +0 -37
- package/lib/program/ops/opVariable.js +0 -20
- package/lib/program/ops/opVariableDefinition.js +0 -24
- package/lib/program/ops/opVoid.js +0 -16
- package/lib/program/ops/utils.js +0 -35
- package/lib/runtime/index.js +0 -258
- package/src/applyDefaults.js +0 -35
- package/src/builtins/funcContains.js +0 -27
- package/src/builtins/funcEndsWith.js +0 -21
- package/src/builtins/funcError.js +0 -7
- package/src/builtins/funcFromJSON.js +0 -24
- package/src/builtins/funcHas.js +0 -25
- package/src/builtins/funcIn.js +0 -25
- package/src/builtins/funcKeys.js +0 -20
- package/src/builtins/funcLength.js +0 -26
- package/src/builtins/funcNow.js +0 -5
- package/src/builtins/funcStartsWith.js +0 -21
- package/src/builtins/funcToJSON.js +0 -5
- package/src/builtins/funcToLowerCase.js +0 -20
- package/src/builtins/funcToNumber.js +0 -25
- package/src/builtins/funcToString.js +0 -5
- package/src/builtins/funcToUpperCase.js +0 -20
- package/src/builtins/funcTrim.js +0 -16
- package/src/builtins/funcTrimEnd.js +0 -16
- package/src/builtins/funcTrimStart.js +0 -16
- package/src/builtins/funcType.js +0 -5
- package/src/builtins/funcVoid.js +0 -5
- package/src/builtins/index.js +0 -193
- package/src/builtins/internals.js +0 -9
- package/src/builtins/math.js +0 -44
- package/src/createSingleton.js +0 -9
- package/src/index.js +0 -44
- package/src/interpreter/index.js +0 -48
- package/src/interpreter/parse.js +0 -1473
- package/src/interpreter/system.js +0 -5
- package/src/interpreter/util.js +0 -237
- package/src/library/apply.js +0 -135
- package/src/library/definition.js +0 -3
- package/src/library/errors/adaptErrors.js +0 -28
- package/src/library/errors/enclosure.js +0 -11
- package/src/library/errors/error.js +0 -14
- package/src/library/errors/execution.js +0 -15
- package/src/library/errors/fatal.js +0 -10
- package/src/library/errors/runtime.js +0 -71
- package/src/library/errors/syntax.js +0 -12
- package/src/library/index.js +0 -41
- package/src/library/mux.js +0 -98
- package/src/library/runtimeScope.js +0 -35
- package/src/library/runtimeSignal.js +0 -67
- package/src/library/types.js +0 -299
- package/src/program/index.js +0 -114
- package/src/program/ops/index.js +0 -82
- package/src/program/ops/opAccess/index.js +0 -55
- package/src/program/ops/opAccess/opaField.js +0 -58
- package/src/program/ops/opAccess/opaFunction.js +0 -52
- package/src/program/ops/opAccess/opaIter.js +0 -34
- package/src/program/ops/opAccess/opaSlice.js +0 -61
- package/src/program/ops/opAnd.js +0 -32
- package/src/program/ops/opArrayConstructor.js +0 -16
- package/src/program/ops/opAssignment/index.js +0 -102
- package/src/program/ops/opAssignment/opaAssignField.js +0 -156
- package/src/program/ops/opAssignment/opaAssignIter.js +0 -77
- package/src/program/ops/opAssignment/opaAssignSlice.js +0 -160
- package/src/program/ops/opAssignment/opuAddition.js +0 -29
- package/src/program/ops/opAssignment/opuDivision.js +0 -29
- package/src/program/ops/opAssignment/opuMultiplication.js +0 -29
- package/src/program/ops/opAssignment/opuNullCoalescence.js +0 -26
- package/src/program/ops/opAssignment/opuRemainder.js +0 -29
- package/src/program/ops/opAssignment/opuSet.js +0 -15
- package/src/program/ops/opAssignment/opuSubtraction.js +0 -29
- package/src/program/ops/opAssignment/opuUpdate.js +0 -15
- package/src/program/ops/opCalculation/index.js +0 -64
- package/src/program/ops/opCalculation/opmAddition.js +0 -63
- package/src/program/ops/opCalculation/opmDivision.js +0 -47
- package/src/program/ops/opCalculation/opmMultiplication.js +0 -52
- package/src/program/ops/opCalculation/opmRemainder.js +0 -49
- package/src/program/ops/opCalculation/opmSubtraction.js +0 -72
- package/src/program/ops/opComparison/index.js +0 -67
- package/src/program/ops/opComparison/opcEqual.js +0 -17
- package/src/program/ops/opComparison/opcGreater.js +0 -17
- package/src/program/ops/opComparison/opcGreaterEqual.js +0 -17
- package/src/program/ops/opComparison/opcLess.js +0 -17
- package/src/program/ops/opComparison/opcLessEqual.js +0 -17
- package/src/program/ops/opComparison/opcUnequal.js +0 -17
- package/src/program/ops/opConstant.js +0 -13
- package/src/program/ops/opConstantFalse.js +0 -11
- package/src/program/ops/opConstantNull.js +0 -11
- package/src/program/ops/opConstantTrue.js +0 -11
- package/src/program/ops/opFunctionDefinition.js +0 -17
- package/src/program/ops/opIf.js +0 -44
- package/src/program/ops/opInterpolatedString.js +0 -27
- package/src/program/ops/opNegation.js +0 -26
- package/src/program/ops/opNot.js +0 -11
- package/src/program/ops/opNullCoalescence.js +0 -36
- package/src/program/ops/opNumber.js +0 -13
- package/src/program/ops/opObjectConstructor.js +0 -40
- package/src/program/ops/opOr.js +0 -32
- package/src/program/ops/opOutputConcat.js +0 -17
- package/src/program/ops/opString.js +0 -13
- package/src/program/ops/opTry.js +0 -38
- package/src/program/ops/opVariable.js +0 -17
- package/src/program/ops/opVariableDefinition.js +0 -18
- package/src/program/ops/opVoid.js +0 -11
- package/src/program/ops/utils.js +0 -19
- package/src/runtime/index.js +0 -309
- /package/{src/builtins/native.js → dist/types/builtins/native.d.ts} +0 -0
- /package/{src/library/ops/index.js → dist/types/library/ops/index.d.ts} +0 -0
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { JPLTypeError, applyObject } from '../../../library';
|
|
2
|
-
import { call } from '../utils';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
/** { by: [op] } */
|
|
6
|
-
op(runtime, input, target, params, scope, next) {
|
|
7
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, async (by) =>
|
|
8
|
-
next(
|
|
9
|
-
await runtime.alterValue(target, (a) => {
|
|
10
|
-
const b = runtime.unwrapValue(by);
|
|
11
|
-
|
|
12
|
-
const ta = runtime.type(a);
|
|
13
|
-
const tb = runtime.type(b);
|
|
14
|
-
|
|
15
|
-
switch (ta) {
|
|
16
|
-
case 'number':
|
|
17
|
-
if (tb === 'number') return a - b;
|
|
18
|
-
break;
|
|
19
|
-
|
|
20
|
-
case 'array':
|
|
21
|
-
if (tb === 'array') {
|
|
22
|
-
if (a.length === 0 || b.length === 0) return a;
|
|
23
|
-
const filtered = a.filter((v) => !b.some((entry) => runtime.equals(v, entry)));
|
|
24
|
-
return a.length === filtered.length ? a : filtered;
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
|
|
28
|
-
case 'string':
|
|
29
|
-
if (tb === 'string') return a.replaceAll(b, '');
|
|
30
|
-
break;
|
|
31
|
-
|
|
32
|
-
case 'object':
|
|
33
|
-
switch (tb) {
|
|
34
|
-
case 'array': {
|
|
35
|
-
if (b.length === 0) return a;
|
|
36
|
-
return applyObject(
|
|
37
|
-
a,
|
|
38
|
-
Object.entries(a)
|
|
39
|
-
.filter(([, v]) => b.some((entry) => runtime.equals(v, entry)))
|
|
40
|
-
.map(([k]) => [k]),
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
case 'string':
|
|
45
|
-
return applyObject(a, [[b]]);
|
|
46
|
-
|
|
47
|
-
default:
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
|
-
|
|
51
|
-
default:
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
throw new JPLTypeError(
|
|
55
|
-
'%s (%*<100v) and %s (%*<100v) cannot be subtracted',
|
|
56
|
-
ta,
|
|
57
|
-
a,
|
|
58
|
-
tb,
|
|
59
|
-
b,
|
|
60
|
-
);
|
|
61
|
-
}),
|
|
62
|
-
),
|
|
63
|
-
);
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
/** { by: function } */
|
|
67
|
-
map(runtime, params) {
|
|
68
|
-
return {
|
|
69
|
-
by: call(params.by),
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
JPLFatalError,
|
|
3
|
-
OPC_EQUAL,
|
|
4
|
-
OPC_GREATER,
|
|
5
|
-
OPC_GREATEREQUAL,
|
|
6
|
-
OPC_LESS,
|
|
7
|
-
OPC_LESSEQUAL,
|
|
8
|
-
OPC_UNEQUAL,
|
|
9
|
-
} from '../../../library';
|
|
10
|
-
import { call } from '../utils';
|
|
11
|
-
import opcEqual from './opcEqual';
|
|
12
|
-
import opcGreater from './opcGreater';
|
|
13
|
-
import opcGreaterEqual from './opcGreaterEqual';
|
|
14
|
-
import opcLess from './opcLess';
|
|
15
|
-
import opcLessEqual from './opcLessEqual';
|
|
16
|
-
import opcUnequal from './opcUnequal';
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
/** { pipe: [op], comparisons: [opc] } */
|
|
20
|
-
op(runtime, input, params, scope, next) {
|
|
21
|
-
const iter = async (from, value) => {
|
|
22
|
-
// Call stack decoupling - This is necessary as some browsers (i.e. Safari) have very limited call stack sizes which result in stack overflow exceptions in certain situations.
|
|
23
|
-
await undefined;
|
|
24
|
-
|
|
25
|
-
scope.signal.checkHealth();
|
|
26
|
-
|
|
27
|
-
if (from >= (params.comparisons?.length ?? 0)) return next(value, scope);
|
|
28
|
-
|
|
29
|
-
const { op, params: opParams } = params.comparisons[from];
|
|
30
|
-
const operator = opcs[op];
|
|
31
|
-
if (!operator) throw new JPLFatalError(`invalid OPC '${op}'`);
|
|
32
|
-
|
|
33
|
-
return operator.op(runtime, input, value, opParams ?? {}, scope, (output) =>
|
|
34
|
-
iter(from + 1, output),
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return runtime.executeInstructions(params.pipe ?? [], [input], scope, (output) =>
|
|
39
|
-
iter(0, output),
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
/** { pipe: function, comparisons: [opc] } */
|
|
44
|
-
map(runtime, params) {
|
|
45
|
-
return {
|
|
46
|
-
pipe: call(params.pipe),
|
|
47
|
-
comparisons: runtime.muxOne([params.comparisons], ({ op, params: opParams }) => {
|
|
48
|
-
const operator = opcs[op];
|
|
49
|
-
if (!operator) throw new JPLFatalError(`invalid OPC '${op}'`);
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
op: runtime.assertType(op, 'string'),
|
|
53
|
-
params: operator.map(runtime, opParams),
|
|
54
|
-
};
|
|
55
|
-
}),
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const opcs = {
|
|
61
|
-
[OPC_EQUAL]: opcEqual,
|
|
62
|
-
[OPC_GREATER]: opcGreater,
|
|
63
|
-
[OPC_GREATEREQUAL]: opcGreaterEqual,
|
|
64
|
-
[OPC_LESS]: opcLess,
|
|
65
|
-
[OPC_LESSEQUAL]: opcLessEqual,
|
|
66
|
-
[OPC_UNEQUAL]: opcUnequal,
|
|
67
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from '../utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { by: [op] } */
|
|
5
|
-
op(runtime, input, target, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, (by) =>
|
|
7
|
-
next(runtime.equals(target, by)),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { by: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
by: call(params.by),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from '../utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { by: [op] } */
|
|
5
|
-
op(runtime, input, target, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, (by) =>
|
|
7
|
-
next(runtime.compare(target, by) > 0),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { by: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
by: call(params.by),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from '../utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { by: [op] } */
|
|
5
|
-
op(runtime, input, target, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, (by) =>
|
|
7
|
-
next(runtime.compare(target, by) >= 0),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { by: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
by: call(params.by),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from '../utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { by: [op] } */
|
|
5
|
-
op(runtime, input, target, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, (by) =>
|
|
7
|
-
next(runtime.compare(target, by) < 0),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { by: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
by: call(params.by),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from '../utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { by: [op] } */
|
|
5
|
-
op(runtime, input, target, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, (by) =>
|
|
7
|
-
next(runtime.compare(target, by) <= 0),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { by: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
by: call(params.by),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from '../utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { by: [op] } */
|
|
5
|
-
op(runtime, input, target, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.by ?? [], [input], scope, (by) =>
|
|
7
|
-
next(!runtime.equals(target, by)),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { by: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
by: call(params.by),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
/** { value: any } */
|
|
3
|
-
op(runtime, input, params, scope, next) {
|
|
4
|
-
return next(params.value ?? null, scope);
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
/** { value: any } */
|
|
8
|
-
map(runtime, params) {
|
|
9
|
-
return {
|
|
10
|
-
value: runtime.normalizeValue(params.value),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { scopedFunction } from '../../library';
|
|
2
|
-
import { call } from './utils';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
/** { argNames: [string], pipe: [op] } */
|
|
6
|
-
op(runtime, input, params, scope, next) {
|
|
7
|
-
return next(scopedFunction(params.argNames ?? [], params.pipe ?? [], scope), scope);
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
/** { argNames: [string], pipe: function } */
|
|
11
|
-
map(runtime, params) {
|
|
12
|
-
return {
|
|
13
|
-
argNames: runtime.muxOne([params.argNames], (entry) => runtime.assertType(entry, 'string')),
|
|
14
|
-
pipe: call(params.pipe),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
package/src/program/ops/opIf.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { call } from './utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { ifs: [{ if: [op], then: [op] }], else: [op] } */
|
|
5
|
-
op(runtime, input, params, scope, next) {
|
|
6
|
-
const iter = async (from) => {
|
|
7
|
-
// Call stack decoupling - This is necessary as some browsers (i.e. Safari) have very limited call stack sizes which result in stack overflow exceptions in certain situations.
|
|
8
|
-
await undefined;
|
|
9
|
-
|
|
10
|
-
scope.signal.checkHealth();
|
|
11
|
-
|
|
12
|
-
if (from >= (params.ifs?.length ?? 0)) {
|
|
13
|
-
return runtime.executeInstructions(params.else ?? [], [input], scope, (output) =>
|
|
14
|
-
next(output, scope),
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const condition = params.ifs[from];
|
|
19
|
-
|
|
20
|
-
return runtime.executeInstructions(condition.if ?? [], [input], scope, (result) => {
|
|
21
|
-
if (runtime.truthy(result)) {
|
|
22
|
-
return runtime.executeInstructions(condition.then ?? [], [input], scope, (output) =>
|
|
23
|
-
next(output, scope),
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return iter(from + 1);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return iter(0);
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
/** { ifs: [{ if: function, then: function }], else: function } */
|
|
35
|
-
map(runtime, params) {
|
|
36
|
-
return {
|
|
37
|
-
ifs: runtime.muxOne([params.ifs], (entry) => ({
|
|
38
|
-
if: call(entry.if),
|
|
39
|
-
then: call(entry.then),
|
|
40
|
-
})),
|
|
41
|
-
else: call(params.else),
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { call } from './utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { interpolations: [{ before: string, pipe: [op] }], after: string } */
|
|
5
|
-
async op(runtime, input, params, scope, next) {
|
|
6
|
-
const interpolations = await runtime.muxAsync([params.interpolations ?? []], (interpolation) =>
|
|
7
|
-
runtime.executeInstructions(interpolation.pipe ?? [], [input], scope, (output) => [
|
|
8
|
-
(interpolation.before ?? '') + runtime.stringifyJSON(output, true),
|
|
9
|
-
]),
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
return runtime.muxAll(interpolations, (...parts) =>
|
|
13
|
-
next(parts.join('') + (params.after ?? ''), scope),
|
|
14
|
-
);
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
/** { interpolations: [{ before: string, pipe: function }], after: string } */
|
|
18
|
-
map(runtime, params) {
|
|
19
|
-
return {
|
|
20
|
-
interpolations: runtime.muxOne([params.interpolations], (entry) => ({
|
|
21
|
-
before: runtime.assertType(entry.before, 'string'),
|
|
22
|
-
pipe: call(entry.pipe),
|
|
23
|
-
})),
|
|
24
|
-
after: runtime.assertType(params.after, 'string'),
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { JPLTypeError } from '../../library';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** {} */
|
|
5
|
-
async op(runtime, input, params, scope, next) {
|
|
6
|
-
return next(
|
|
7
|
-
await runtime.alterValue(input, (value) => {
|
|
8
|
-
const t = runtime.type(value);
|
|
9
|
-
switch (t) {
|
|
10
|
-
case 'number':
|
|
11
|
-
return -value;
|
|
12
|
-
|
|
13
|
-
default:
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
throw new JPLTypeError('%s (%*<100v) cannot be negated', t, value);
|
|
17
|
-
}),
|
|
18
|
-
scope,
|
|
19
|
-
);
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
/** {} */
|
|
23
|
-
map() {
|
|
24
|
-
return {};
|
|
25
|
-
},
|
|
26
|
-
};
|
package/src/program/ops/opNot.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { call } from './utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { pipes: [[op]] } */
|
|
5
|
-
op(runtime, input, params, scope, next) {
|
|
6
|
-
const iter = async (from) => {
|
|
7
|
-
// Call stack decoupling - This is necessary as some browsers (i.e. Safari) have very limited call stack sizes which result in stack overflow exceptions in certain situations.
|
|
8
|
-
await undefined;
|
|
9
|
-
|
|
10
|
-
scope.signal.checkHealth();
|
|
11
|
-
|
|
12
|
-
if (from >= (params.pipes?.length ?? 0)) return next(null, scope);
|
|
13
|
-
|
|
14
|
-
const pipe = params.pipes[from];
|
|
15
|
-
|
|
16
|
-
return runtime.executeInstructions(pipe ?? [], [input], scope, (output) => {
|
|
17
|
-
switch (runtime.type(output)) {
|
|
18
|
-
case 'null':
|
|
19
|
-
return iter(from + 1);
|
|
20
|
-
|
|
21
|
-
default:
|
|
22
|
-
return next(output, scope);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return iter(0);
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
/** { pipes: [function] } */
|
|
31
|
-
map(runtime, params) {
|
|
32
|
-
return {
|
|
33
|
-
pipes: runtime.muxOne([params.pipes], (pipe) => call(pipe)),
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
/** { number: number } */
|
|
3
|
-
op(runtime, input, params, scope, next) {
|
|
4
|
-
return next(params.number ?? 0, scope);
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
/** { number: number } */
|
|
8
|
-
map(runtime, params) {
|
|
9
|
-
return {
|
|
10
|
-
number: runtime.assertType(params.number, 'number'),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { JPLTypeError } from '../../library';
|
|
2
|
-
import { call } from './utils';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
/** { fields: [{ key: [op], value: [op], optional: boolean }] } */
|
|
6
|
-
async op(runtime, input, params, scope, next) {
|
|
7
|
-
const fields = await runtime.muxAsync([params.fields ?? []], async (field) => {
|
|
8
|
-
const [keys, values] = await Promise.all([
|
|
9
|
-
runtime.executeInstructions(field.key ?? [], [input], scope),
|
|
10
|
-
runtime.executeInstructions(field.value ?? [], [input], scope),
|
|
11
|
-
]);
|
|
12
|
-
|
|
13
|
-
return runtime.muxAll([runtime.unwrapValues(keys), values], (key, value) => {
|
|
14
|
-
const t = runtime.type(key);
|
|
15
|
-
switch (t) {
|
|
16
|
-
case 'string':
|
|
17
|
-
return [[key, value]];
|
|
18
|
-
|
|
19
|
-
default:
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (field.optional) return [];
|
|
23
|
-
throw new JPLTypeError('cannot use %s (%*<100v) as object key', t, key);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return runtime.muxAll(fields, (...entries) => next(Object.fromEntries(entries), scope));
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
/** { fields: [{ key: function, value: function, optional: boolean }] } */
|
|
31
|
-
map(runtime, params) {
|
|
32
|
-
return {
|
|
33
|
-
fields: runtime.muxOne([params.fields], (entry) => ({
|
|
34
|
-
key: call(entry.key),
|
|
35
|
-
value: call(entry.value),
|
|
36
|
-
optional: runtime.assertType(entry.optional, 'boolean'),
|
|
37
|
-
})),
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
};
|
package/src/program/ops/opOr.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { call } from './utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { pipes: [[op]] } */
|
|
5
|
-
op(runtime, input, params, scope, next) {
|
|
6
|
-
const iter = async (from) => {
|
|
7
|
-
// Call stack decoupling - This is necessary as some browsers (i.e. Safari) have very limited call stack sizes which result in stack overflow exceptions in certain situations.
|
|
8
|
-
await undefined;
|
|
9
|
-
|
|
10
|
-
scope.signal.checkHealth();
|
|
11
|
-
|
|
12
|
-
if (from >= (params.pipes?.length ?? 0)) return next(false, scope);
|
|
13
|
-
|
|
14
|
-
const pipe = params.pipes[from];
|
|
15
|
-
|
|
16
|
-
return runtime.executeInstructions(pipe ?? [], [input], scope, (output) => {
|
|
17
|
-
if (runtime.truthy(output)) return next(true, scope);
|
|
18
|
-
|
|
19
|
-
return iter(from + 1);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return iter(0);
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
/** { pipes: [function] } */
|
|
27
|
-
map(runtime, params) {
|
|
28
|
-
return {
|
|
29
|
-
pipes: runtime.muxOne([params.pipes], (pipe) => call(pipe)),
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { call } from './utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { pipes: [[op]] } */
|
|
5
|
-
op(runtime, input, params, scope, next) {
|
|
6
|
-
return runtime.muxAll([params.pipes ?? []], (pipe) =>
|
|
7
|
-
runtime.executeInstructions(pipe ?? [], [input], scope, (output) => next(output, scope)),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { pipes: [function] } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
pipes: runtime.muxOne([params.pipes], (value) => call(value)),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
/** { string: string } */
|
|
3
|
-
op(runtime, input, params, scope, next) {
|
|
4
|
-
return next(params.string ?? '', scope);
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
/** { string: string } */
|
|
8
|
-
map(runtime, params) {
|
|
9
|
-
return {
|
|
10
|
-
string: runtime.assertType(params.string, 'string'),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
};
|
package/src/program/ops/opTry.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { JPLErrorEnclosure, JPLExecutionError } from '../../library';
|
|
2
|
-
import { call } from './utils';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
/** { try: [op], catch: [op] } */
|
|
6
|
-
async op(runtime, input, params, scope, next) {
|
|
7
|
-
const nextScope = scope.next({ signal: scope.signal.next() });
|
|
8
|
-
try {
|
|
9
|
-
return await runtime.executeInstructions(
|
|
10
|
-
params.try ?? [],
|
|
11
|
-
[input],
|
|
12
|
-
nextScope,
|
|
13
|
-
async (output) => {
|
|
14
|
-
try {
|
|
15
|
-
return await next(output, scope);
|
|
16
|
-
} catch (err) {
|
|
17
|
-
throw new JPLErrorEnclosure(err);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
);
|
|
21
|
-
} catch (err) {
|
|
22
|
-
if (JPLErrorEnclosure.is(err)) throw err.inner;
|
|
23
|
-
if (!JPLExecutionError.is(err)) throw err;
|
|
24
|
-
nextScope.signal.exit();
|
|
25
|
-
return runtime.executeInstructions(params.catch ?? [], [err.value], scope, (output) =>
|
|
26
|
-
next(output, scope),
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
/** { try: function, catch: function } */
|
|
32
|
-
map(runtime, params) {
|
|
33
|
-
return {
|
|
34
|
-
try: call(params.try),
|
|
35
|
-
catch: call(params.catch),
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { JPLReferenceError } from '../../library';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { name: string } */
|
|
5
|
-
op(runtime, input, params, scope, next) {
|
|
6
|
-
if (!Object.hasOwn(scope.vars, params.name ?? ''))
|
|
7
|
-
throw new JPLReferenceError('%s is not defined', params.name ?? '');
|
|
8
|
-
return next(scope.vars[params.name ?? ''], scope);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { name: string } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
name: runtime.assertType(params.name, 'string'),
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { call } from './utils';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/** { name: string, pipe: [op] } */
|
|
5
|
-
op(runtime, input, params, scope, next) {
|
|
6
|
-
return runtime.executeInstructions(params.pipe ?? [], [input], scope, (output) =>
|
|
7
|
-
next(input, scope.next({ vars: { [params.name ?? '']: output } })),
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
/** { name: string, pipe: function } */
|
|
12
|
-
map(runtime, params) {
|
|
13
|
-
return {
|
|
14
|
-
name: runtime.assertType(params.name, 'string'),
|
|
15
|
-
pipe: call(params.pipe),
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
};
|