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.
package/dist/parsing/parser.d.ts
CHANGED
|
@@ -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 {
|
package/dist/parsing/parser.js
CHANGED
|
@@ -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 {
|
package/package.json
CHANGED
package/src/parsing/parser.ts
CHANGED
|
@@ -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
|
});
|