@bpmnkit/feel 0.0.13 → 0.0.16
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/README.md +4 -0
- package/dist/evaluator.js +5 -3
- package/dist/parser.js +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@bpmnkit/feel)
|
|
7
7
|
[](https://github.com/bpmnkit/monorepo/blob/main/LICENSE)
|
|
8
8
|
[](https://github.com/bpmnkit/monorepo)
|
|
9
|
+
[](https://github.com/bpmnkit/monorepo)
|
|
10
|
+
[](https://github.com/bpmnkit/monorepo)
|
|
9
11
|
|
|
10
12
|
[Website](https://bpmnkit.com) · [Documentation](https://docs.bpmnkit.com) · [GitHub](https://github.com/bpmnkit/monorepo) · [Changelog](https://github.com/bpmnkit/monorepo/blob/main/packages/feel/CHANGELOG.md)
|
|
11
13
|
</div>
|
|
@@ -113,6 +115,8 @@ interface ParseResult {
|
|
|
113
115
|
| [`@bpmnkit/cli-sdk`](https://www.npmjs.com/package/@bpmnkit/cli-sdk) | Plugin authoring SDK for the casen CLI |
|
|
114
116
|
| [`@bpmnkit/create-casen-plugin`](https://www.npmjs.com/package/@bpmnkit/create-casen-plugin) | Scaffold a new casen CLI plugin in seconds |
|
|
115
117
|
| [`@bpmnkit/casen-report`](https://www.npmjs.com/package/@bpmnkit/casen-report) | HTML reports from Camunda 8 incident and SLA data |
|
|
118
|
+
| [`@bpmnkit/casen-worker-http`](https://www.npmjs.com/package/@bpmnkit/casen-worker-http) | Example HTTP worker plugin — completes jobs with live JSONPlaceholder API data |
|
|
119
|
+
| [`@bpmnkit/casen-worker-ai`](https://www.npmjs.com/package/@bpmnkit/casen-worker-ai) | AI task worker — classify, summarize, extract, and decide using Claude |
|
|
116
120
|
|
|
117
121
|
## License
|
|
118
122
|
|
package/dist/evaluator.js
CHANGED
|
@@ -574,10 +574,12 @@ export function evaluateUnaryTest(node, input, ctx) {
|
|
|
574
574
|
// List result → any element matches
|
|
575
575
|
if (isFeelList(result))
|
|
576
576
|
return result.some((r) => testIncludes(r, input) === true);
|
|
577
|
-
// A plain expression in unary test mode is an equality test
|
|
578
|
-
|
|
577
|
+
// A plain expression in unary test mode is an equality test.
|
|
578
|
+
// When the result is null: only match if the node itself is the null literal
|
|
579
|
+
// (null arithmetic in comparisons also yields null but must not match anything).
|
|
580
|
+
if (result !== null)
|
|
579
581
|
return deepEqual(result, input);
|
|
580
|
-
return false;
|
|
582
|
+
return node.kind === "null" ? input === null : false;
|
|
581
583
|
}
|
|
582
584
|
/** Evaluate a full unary-test node (the root returned by parseUnaryTests). */
|
|
583
585
|
export function evaluateUnaryTests(node, input, ctx) {
|
package/dist/parser.js
CHANGED
|
@@ -809,6 +809,24 @@ class Parser {
|
|
|
809
809
|
if (tok.kind === "punct" && (tok.value === "[" || tok.value === "(")) {
|
|
810
810
|
return this.parseListOrRange() ?? this.parseParenOrRange();
|
|
811
811
|
}
|
|
812
|
+
// "instance of X" in unary-test context — implicit input "?" is the subject
|
|
813
|
+
if (tok.kind === "keyword" && tok.value === "instance") {
|
|
814
|
+
const start = tok.start;
|
|
815
|
+
this.advance();
|
|
816
|
+
if (!this.expect("keyword", "of"))
|
|
817
|
+
return null;
|
|
818
|
+
const typeName = this.parseTypeName();
|
|
819
|
+
if (!typeName)
|
|
820
|
+
return null;
|
|
821
|
+
const implicitInput = { kind: "name", name: "?", start, end: start };
|
|
822
|
+
return {
|
|
823
|
+
kind: "instance-of",
|
|
824
|
+
value: implicitInput,
|
|
825
|
+
typeName,
|
|
826
|
+
start,
|
|
827
|
+
end: this.pos > 0 ? (this.tokens[this.pos - 1]?.end ?? start) : start,
|
|
828
|
+
};
|
|
829
|
+
}
|
|
812
830
|
// Expression equality test
|
|
813
831
|
return this.parseExpression(0);
|
|
814
832
|
}
|