flowquery 1.0.10 → 1.0.11

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.
@@ -10,7 +10,7 @@ import BaseParser from "./base_parser";
10
10
  * @example
11
11
  * ```typescript
12
12
  * const parser = new Parser();
13
- * const ast = parser.parse("unwind [1, 2, 3, 4] as num return num");
13
+ * const ast = parser.parse("unwind [1, 2, 3, 4, 5] as num return num");
14
14
  * ```
15
15
  */
16
16
  declare class Parser extends BaseParser {
@@ -51,7 +51,7 @@ const null_1 = __importDefault(require("./components/null"));
51
51
  * @example
52
52
  * ```typescript
53
53
  * const parser = new Parser();
54
- * const ast = parser.parse("unwind [1, 2, 3, 4] as num return num");
54
+ * const ast = parser.parse("unwind [1, 2, 3, 4, 5] as num return num");
55
55
  * ```
56
56
  */
57
57
  class Parser extends base_parser_1.default {
@@ -20,7 +20,7 @@
20
20
  "@fluentui/react-icons": "^2.0.316",
21
21
  "adaptivecards": "^3.0.5",
22
22
  "adaptivecards-templating": "^2.3.1",
23
- "flowquery": "^1.0.9",
23
+ "flowquery": "^1.0.10",
24
24
  "react": "^19.2.3",
25
25
  "react-dom": "^19.2.3"
26
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowquery",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "A declarative query language for data processing pipelines.",
5
5
  "main": "dist/index.node.js",
6
6
  "types": "dist/index.node.d.ts",
@@ -49,7 +49,7 @@ import Null from "./components/null";
49
49
  * @example
50
50
  * ```typescript
51
51
  * const parser = new Parser();
52
- * const ast = parser.parse("unwind [1, 2, 3, 4] as num return num");
52
+ * const ast = parser.parse("unwind [1, 2, 3, 4, 5] as num return num");
53
53
  * ```
54
54
  */
55
55
  class Parser extends BaseParser {
@@ -503,4 +503,24 @@ test('Test keys function', async () => {
503
503
  const results = runner.results;
504
504
  expect(results.length).toBe(1);
505
505
  expect(results[0]).toEqual({'keys': ['name', 'age']});
506
+ });
507
+
508
+ test('Test type function', async () => {
509
+ const runner = new Runner(`
510
+ RETURN type(123) as type1,
511
+ type("hello") as type2,
512
+ type([1, 2, 3]) as type3,
513
+ type({a: 1, b: 2}) as type4,
514
+ type(null) as type5
515
+ `);
516
+ await runner.run();
517
+ const results = runner.results;
518
+ expect(results.length).toBe(1);
519
+ expect(results[0]).toEqual({
520
+ 'type1': 'number',
521
+ 'type2': 'string',
522
+ 'type3': 'array',
523
+ 'type4': 'object',
524
+ 'type5': 'null'
525
+ });
506
526
  });