@jmespath-community/jmespath 1.2.0 → 1.3.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/README.md +76 -4
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +2181 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.cjs +2118 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +412 -0
- package/dist/index.d.ts +412 -0
- package/dist/index.esm.js +2099 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.esm.min.js +2 -0
- package/dist/index.esm.min.js.map +1 -0
- package/dist/index.mjs +2089 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +2133 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/index.umd.min.js +2 -0
- package/dist/index.umd.min.js.map +1 -0
- package/package.json +28 -6
- package/dist/jmespath.esm.js +0 -2369
- package/dist/jmespath.esm.min.js +0 -2
- package/dist/jmespath.esm.min.js.map +0 -1
- package/dist/jmespath.umd.js +0 -2398
- package/dist/jmespath.umd.min.js +0 -2
- package/dist/jmespath.umd.min.js.map +0 -1
- package/dist/lib/bin/jp.js +0 -127
- package/dist/lib/bin/jp.js.map +0 -1
- package/dist/lib/package.json +0 -70
- package/dist/lib/src/AST.type.js +0 -3
- package/dist/lib/src/AST.type.js.map +0 -1
- package/dist/lib/src/JSON.type.js +0 -3
- package/dist/lib/src/JSON.type.js.map +0 -1
- package/dist/lib/src/Lexer.js +0 -327
- package/dist/lib/src/Lexer.js.map +0 -1
- package/dist/lib/src/Lexer.type.js +0 -46
- package/dist/lib/src/Lexer.type.js.map +0 -1
- package/dist/lib/src/Parser.js +0 -468
- package/dist/lib/src/Parser.js.map +0 -1
- package/dist/lib/src/Parser.type.js +0 -3
- package/dist/lib/src/Parser.type.js.map +0 -1
- package/dist/lib/src/Runtime.js +0 -924
- package/dist/lib/src/Runtime.js.map +0 -1
- package/dist/lib/src/Scope.js +0 -29
- package/dist/lib/src/Scope.js.map +0 -1
- package/dist/lib/src/TreeInterpreter.js +0 -319
- package/dist/lib/src/TreeInterpreter.js.map +0 -1
- package/dist/lib/src/index.js +0 -65
- package/dist/lib/src/index.js.map +0 -1
- package/dist/lib/src/utils/index.js +0 -145
- package/dist/lib/src/utils/index.js.map +0 -1
- package/dist/lib/src/utils/strings.js +0 -92
- package/dist/lib/src/utils/strings.js.map +0 -1
- package/dist/lib/src/utils/text.js +0 -45
- package/dist/lib/src/utils/text.js.map +0 -1
- package/dist/types/bin/jp.d.ts +0 -2
- package/dist/types/src/AST.type.d.ts +0 -104
- package/dist/types/src/JSON.type.d.ts +0 -10
- package/dist/types/src/Lexer.d.ts +0 -19
- package/dist/types/src/Lexer.type.d.ts +0 -51
- package/dist/types/src/Parser.d.ts +0 -33
- package/dist/types/src/Parser.type.d.ts +0 -4
- package/dist/types/src/Runtime.d.ts +0 -87
- package/dist/types/src/Scope.d.ts +0 -8
- package/dist/types/src/TreeInterpreter.d.ts +0 -22
- package/dist/types/src/index.d.ts +0 -45
- package/dist/types/src/utils/index.d.ts +0 -16
- package/dist/types/src/utils/strings.d.ts +0 -11
- package/dist/types/src/utils/text.d.ts +0 -11
package/dist/lib/package.json
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@jmespath-community/jmespath",
|
|
3
|
-
"description": "Typescript implementation of the JMESPath Community specification",
|
|
4
|
-
"version": "1.2.0",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "JMESPath Community",
|
|
7
|
-
"email": "springcomp@users.noreply.github.com",
|
|
8
|
-
"url": "https://jmespath.site"
|
|
9
|
-
},
|
|
10
|
-
"main": "dist/jmespath.umd.js",
|
|
11
|
-
"bin": {
|
|
12
|
-
"jp": "dist/lib/bin/jp.js"
|
|
13
|
-
},
|
|
14
|
-
"module": "dist/jmespath.esm.js",
|
|
15
|
-
"typings": "dist/types/index.d.ts",
|
|
16
|
-
"types": "dist/types/index.d.ts",
|
|
17
|
-
"files": ["dist/"],
|
|
18
|
-
"homepage": "https://github.com/nanoporetech/jmespath-ts#readme",
|
|
19
|
-
"bugs": {
|
|
20
|
-
"url": "https://github.com/nanoporetech/jmespath-ts/issues",
|
|
21
|
-
"mail": ""
|
|
22
|
-
},
|
|
23
|
-
"keywords": ["jmespath", "jsonpath", "query", "json", "jq", "xpath"],
|
|
24
|
-
"contributors": [],
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "git://github.com/jmespath-community/typescript-jmespath"
|
|
28
|
-
},
|
|
29
|
-
"license": "MPL-2.0",
|
|
30
|
-
"engines": {
|
|
31
|
-
"node": ">=14.0.0"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"lint": "biome check",
|
|
35
|
-
"lint:fix": "biome check --write",
|
|
36
|
-
"lint:ci": "biome check --diagnostic-level=error",
|
|
37
|
-
"prebuild": "npx rimraf dist",
|
|
38
|
-
"build": "npx tsc --outDir dist/lib -d --module commonjs && npx rollup -c rollup.config.ts",
|
|
39
|
-
"perf": "node --expose-gc scripts/perf.js",
|
|
40
|
-
"start": "npx rollup -c rollup.config.ts -w",
|
|
41
|
-
"test": "vitest --run",
|
|
42
|
-
"test:watch": "vitest",
|
|
43
|
-
"test:prod": "npm run lint && npm run test",
|
|
44
|
-
"coverage": "vitest run --coverage",
|
|
45
|
-
"deploy-docs": "ts-node scripts/gh-pages-publish",
|
|
46
|
-
"report-coverage": "cat ./coverage/lcov.info | coveralls",
|
|
47
|
-
"precommit": "lint-staged",
|
|
48
|
-
"prepack": "npx clear-package-json package.json --output ./package.json"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@biomejs/biome": "1.9.4",
|
|
52
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
53
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
54
|
-
"@rollup/plugin-terser": "^0.4.0",
|
|
55
|
-
"@rollup/plugin-typescript": "^8.2.1",
|
|
56
|
-
"@vitest/coverage-v8": "^3.0.8",
|
|
57
|
-
"clean-publish": "^3.4.5",
|
|
58
|
-
"coveralls-next": "^4.2.0",
|
|
59
|
-
"husky": "^6.0.0",
|
|
60
|
-
"lint-staged": "^11.0.0",
|
|
61
|
-
"rimraf": "^3.0.2",
|
|
62
|
-
"rollup": "^2.50.5",
|
|
63
|
-
"rollup-plugin-typescript2": "^0.34.1",
|
|
64
|
-
"shelljs": "^0.8.4",
|
|
65
|
-
"tinybench": "^2.5.1",
|
|
66
|
-
"ts-node": "^10.9.1",
|
|
67
|
-
"typescript": "^4.3.2",
|
|
68
|
-
"vitest": "^3.0.8"
|
|
69
|
-
}
|
|
70
|
-
}
|
package/dist/lib/src/AST.type.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AST.type.js","sourceRoot":"","sources":["../../../src/AST.type.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JSON.type.js","sourceRoot":"","sources":["../../../src/JSON.type.ts"],"names":[],"mappings":""}
|
package/dist/lib/src/Lexer.js
DELETED
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Lexer = exports.basicTokens = void 0;
|
|
4
|
-
const Lexer_type_1 = require("./Lexer.type");
|
|
5
|
-
const index_1 = require("./utils/index");
|
|
6
|
-
const strings_1 = require("./utils/strings");
|
|
7
|
-
exports.basicTokens = {
|
|
8
|
-
'(': Lexer_type_1.Token.TOK_LPAREN,
|
|
9
|
-
')': Lexer_type_1.Token.TOK_RPAREN,
|
|
10
|
-
'*': Lexer_type_1.Token.TOK_STAR,
|
|
11
|
-
',': Lexer_type_1.Token.TOK_COMMA,
|
|
12
|
-
'.': Lexer_type_1.Token.TOK_DOT,
|
|
13
|
-
':': Lexer_type_1.Token.TOK_COLON,
|
|
14
|
-
'@': Lexer_type_1.Token.TOK_CURRENT,
|
|
15
|
-
']': Lexer_type_1.Token.TOK_RBRACKET,
|
|
16
|
-
'{': Lexer_type_1.Token.TOK_LBRACE,
|
|
17
|
-
'}': Lexer_type_1.Token.TOK_RBRACE,
|
|
18
|
-
'+': Lexer_type_1.Token.TOK_PLUS,
|
|
19
|
-
'%': Lexer_type_1.Token.TOK_MODULO,
|
|
20
|
-
'?': Lexer_type_1.Token.TOK_QUESTION,
|
|
21
|
-
'\u2212': Lexer_type_1.Token.TOK_MINUS,
|
|
22
|
-
'\u00d7': Lexer_type_1.Token.TOK_MULTIPLY,
|
|
23
|
-
'\u00f7': Lexer_type_1.Token.TOK_DIVIDE,
|
|
24
|
-
};
|
|
25
|
-
const operatorStartToken = {
|
|
26
|
-
'!': true,
|
|
27
|
-
'<': true,
|
|
28
|
-
'=': true,
|
|
29
|
-
'>': true,
|
|
30
|
-
'&': true,
|
|
31
|
-
'|': true,
|
|
32
|
-
'/': true,
|
|
33
|
-
};
|
|
34
|
-
const skipChars = {
|
|
35
|
-
'\t': true,
|
|
36
|
-
'\n': true,
|
|
37
|
-
'\r': true,
|
|
38
|
-
' ': true,
|
|
39
|
-
};
|
|
40
|
-
class StreamLexer {
|
|
41
|
-
constructor() {
|
|
42
|
-
this._current = 0;
|
|
43
|
-
this._enable_legacy_literals = false;
|
|
44
|
-
}
|
|
45
|
-
tokenize(stream, options) {
|
|
46
|
-
const tokens = [];
|
|
47
|
-
this._current = 0;
|
|
48
|
-
this._enable_legacy_literals = (options === null || options === void 0 ? void 0 : options.enable_legacy_literals) || false;
|
|
49
|
-
let start;
|
|
50
|
-
let identifier;
|
|
51
|
-
let token;
|
|
52
|
-
while (this._current < stream.length) {
|
|
53
|
-
if ((0, index_1.isAlpha)(stream[this._current])) {
|
|
54
|
-
start = this._current;
|
|
55
|
-
identifier = this.consumeUnquotedIdentifier(stream);
|
|
56
|
-
tokens.push({
|
|
57
|
-
start,
|
|
58
|
-
type: Lexer_type_1.Token.TOK_UNQUOTEDIDENTIFIER,
|
|
59
|
-
value: identifier,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
else if (exports.basicTokens[stream[this._current]] !== undefined) {
|
|
63
|
-
tokens.push({
|
|
64
|
-
start: this._current,
|
|
65
|
-
type: exports.basicTokens[stream[this._current]],
|
|
66
|
-
value: stream[this._current],
|
|
67
|
-
});
|
|
68
|
-
this._current += 1;
|
|
69
|
-
}
|
|
70
|
-
else if (stream[this._current] === '$') {
|
|
71
|
-
start = this._current;
|
|
72
|
-
if (this._current + 1 < stream.length && (0, index_1.isAlpha)(stream[this._current + 1])) {
|
|
73
|
-
this._current += 1;
|
|
74
|
-
identifier = this.consumeUnquotedIdentifier(stream);
|
|
75
|
-
tokens.push({
|
|
76
|
-
start,
|
|
77
|
-
type: Lexer_type_1.Token.TOK_VARIABLE,
|
|
78
|
-
value: identifier,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
tokens.push({
|
|
83
|
-
start: start,
|
|
84
|
-
type: Lexer_type_1.Token.TOK_ROOT,
|
|
85
|
-
value: stream[this._current],
|
|
86
|
-
});
|
|
87
|
-
this._current += 1;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (stream[this._current] === '-') {
|
|
91
|
-
if (this._current + 1 < stream.length && (0, index_1.isNum)(stream[this._current + 1])) {
|
|
92
|
-
const token = this.consumeNumber(stream);
|
|
93
|
-
token && tokens.push(token);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
const token = {
|
|
97
|
-
start: this._current,
|
|
98
|
-
type: Lexer_type_1.Token.TOK_MINUS,
|
|
99
|
-
value: '-',
|
|
100
|
-
};
|
|
101
|
-
tokens.push(token);
|
|
102
|
-
this._current += 1;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if ((0, index_1.isNum)(stream[this._current])) {
|
|
106
|
-
token = this.consumeNumber(stream);
|
|
107
|
-
tokens.push(token);
|
|
108
|
-
}
|
|
109
|
-
else if (stream[this._current] === '[') {
|
|
110
|
-
token = this.consumeLBracket(stream);
|
|
111
|
-
tokens.push(token);
|
|
112
|
-
}
|
|
113
|
-
else if (stream[this._current] === '"') {
|
|
114
|
-
start = this._current;
|
|
115
|
-
identifier = this.consumeQuotedIdentifier(stream);
|
|
116
|
-
tokens.push({
|
|
117
|
-
start,
|
|
118
|
-
type: Lexer_type_1.Token.TOK_QUOTEDIDENTIFIER,
|
|
119
|
-
value: identifier,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
else if (stream[this._current] === `'`) {
|
|
123
|
-
start = this._current;
|
|
124
|
-
identifier = this.consumeRawStringLiteral(stream);
|
|
125
|
-
tokens.push({
|
|
126
|
-
start,
|
|
127
|
-
type: Lexer_type_1.Token.TOK_LITERAL,
|
|
128
|
-
value: identifier,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
else if (stream[this._current] === '`') {
|
|
132
|
-
start = this._current;
|
|
133
|
-
const literal = this.consumeLiteral(stream);
|
|
134
|
-
tokens.push({
|
|
135
|
-
start,
|
|
136
|
-
type: Lexer_type_1.Token.TOK_LITERAL,
|
|
137
|
-
value: literal,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
else if (operatorStartToken[stream[this._current]] !== undefined) {
|
|
141
|
-
token = this.consumeOperator(stream);
|
|
142
|
-
token && tokens.push(token);
|
|
143
|
-
}
|
|
144
|
-
else if (skipChars[stream[this._current]] !== undefined) {
|
|
145
|
-
this._current += 1;
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
const error = new Error(`Syntax error: unknown character: ${stream[this._current]}`);
|
|
149
|
-
error.name = 'LexerError';
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return tokens;
|
|
154
|
-
}
|
|
155
|
-
consumeUnquotedIdentifier(stream) {
|
|
156
|
-
const start = this._current;
|
|
157
|
-
this._current += 1;
|
|
158
|
-
while (this._current < stream.length && (0, index_1.isAlphaNum)(stream[this._current])) {
|
|
159
|
-
this._current += 1;
|
|
160
|
-
}
|
|
161
|
-
return stream.slice(start, this._current);
|
|
162
|
-
}
|
|
163
|
-
consumeQuotedIdentifier(stream) {
|
|
164
|
-
const start = this._current;
|
|
165
|
-
this._current += 1;
|
|
166
|
-
const maxLength = stream.length;
|
|
167
|
-
while (stream[this._current] !== '"' && this._current < maxLength) {
|
|
168
|
-
let current = this._current;
|
|
169
|
-
if (stream[current] === '\\' && (stream[current + 1] === '\\' || stream[current + 1] === '"')) {
|
|
170
|
-
current += 2;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
current += 1;
|
|
174
|
-
}
|
|
175
|
-
this._current = current;
|
|
176
|
-
}
|
|
177
|
-
this._current += 1;
|
|
178
|
-
const [value, ok] = this.parseJSON(stream.slice(start, this._current));
|
|
179
|
-
if (!ok) {
|
|
180
|
-
const error = new Error(`syntax: unexpected end of JSON input`);
|
|
181
|
-
error.name = 'LexerError';
|
|
182
|
-
throw error;
|
|
183
|
-
}
|
|
184
|
-
return value;
|
|
185
|
-
}
|
|
186
|
-
consumeRawStringLiteral(stream) {
|
|
187
|
-
const start = this._current;
|
|
188
|
-
this._current += 1;
|
|
189
|
-
const maxLength = stream.length;
|
|
190
|
-
while (stream[this._current] !== `'` && this._current < maxLength) {
|
|
191
|
-
let current = this._current;
|
|
192
|
-
if (stream[current] === '\\' && (stream[current + 1] === '\\' || stream[current + 1] === `'`)) {
|
|
193
|
-
current += 2;
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
current += 1;
|
|
197
|
-
}
|
|
198
|
-
this._current = current;
|
|
199
|
-
}
|
|
200
|
-
this._current += 1;
|
|
201
|
-
const literal = stream.slice(start + 1, this._current - 1);
|
|
202
|
-
return (0, strings_1.replace)((0, strings_1.replace)(literal, `\\\\`, `\\`), `\\'`, `'`);
|
|
203
|
-
}
|
|
204
|
-
consumeNumber(stream) {
|
|
205
|
-
const start = this._current;
|
|
206
|
-
this._current += 1;
|
|
207
|
-
const maxLength = stream.length;
|
|
208
|
-
while ((0, index_1.isNum)(stream[this._current]) && this._current < maxLength) {
|
|
209
|
-
this._current += 1;
|
|
210
|
-
}
|
|
211
|
-
const value = parseInt(stream.slice(start, this._current), 10);
|
|
212
|
-
return { start, value, type: Lexer_type_1.Token.TOK_NUMBER };
|
|
213
|
-
}
|
|
214
|
-
consumeLBracket(stream) {
|
|
215
|
-
const start = this._current;
|
|
216
|
-
this._current += 1;
|
|
217
|
-
if (stream[this._current] === '?') {
|
|
218
|
-
this._current += 1;
|
|
219
|
-
return { start, type: Lexer_type_1.Token.TOK_FILTER, value: '[?' };
|
|
220
|
-
}
|
|
221
|
-
if (stream[this._current] === ']') {
|
|
222
|
-
this._current += 1;
|
|
223
|
-
return { start, type: Lexer_type_1.Token.TOK_FLATTEN, value: '[]' };
|
|
224
|
-
}
|
|
225
|
-
return { start, type: Lexer_type_1.Token.TOK_LBRACKET, value: '[' };
|
|
226
|
-
}
|
|
227
|
-
consumeOrElse(stream, peek, token, orElse) {
|
|
228
|
-
const start = this._current;
|
|
229
|
-
this._current += 1;
|
|
230
|
-
if (this._current < stream.length && stream[this._current] === peek) {
|
|
231
|
-
this._current += 1;
|
|
232
|
-
return {
|
|
233
|
-
start: start,
|
|
234
|
-
type: orElse,
|
|
235
|
-
value: stream.slice(start, this._current),
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
return { start: start, type: token, value: stream[start] };
|
|
239
|
-
}
|
|
240
|
-
consumeOperator(stream) {
|
|
241
|
-
const start = this._current;
|
|
242
|
-
const startingChar = stream[start];
|
|
243
|
-
switch (startingChar) {
|
|
244
|
-
case '!':
|
|
245
|
-
return this.consumeOrElse(stream, '=', Lexer_type_1.Token.TOK_NOT, Lexer_type_1.Token.TOK_NE);
|
|
246
|
-
case '<':
|
|
247
|
-
return this.consumeOrElse(stream, '=', Lexer_type_1.Token.TOK_LT, Lexer_type_1.Token.TOK_LTE);
|
|
248
|
-
case '>':
|
|
249
|
-
return this.consumeOrElse(stream, '=', Lexer_type_1.Token.TOK_GT, Lexer_type_1.Token.TOK_GTE);
|
|
250
|
-
case '=':
|
|
251
|
-
return this.consumeOrElse(stream, '=', Lexer_type_1.Token.TOK_ASSIGN, Lexer_type_1.Token.TOK_EQ);
|
|
252
|
-
case '&':
|
|
253
|
-
return this.consumeOrElse(stream, '&', Lexer_type_1.Token.TOK_EXPREF, Lexer_type_1.Token.TOK_AND);
|
|
254
|
-
case '|':
|
|
255
|
-
return this.consumeOrElse(stream, '|', Lexer_type_1.Token.TOK_PIPE, Lexer_type_1.Token.TOK_OR);
|
|
256
|
-
case '/':
|
|
257
|
-
return this.consumeOrElse(stream, '/', Lexer_type_1.Token.TOK_DIVIDE, Lexer_type_1.Token.TOK_DIV);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
consumeLiteral(stream) {
|
|
261
|
-
this._current += 1;
|
|
262
|
-
const start = this._current;
|
|
263
|
-
const maxLength = stream.length;
|
|
264
|
-
while (stream[this._current] !== '`' && this._current < maxLength) {
|
|
265
|
-
let current = this._current;
|
|
266
|
-
if (stream[current] === '\\' && (stream[current + 1] === '\\' || stream[current + 1] === '`')) {
|
|
267
|
-
current += 2;
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
current += 1;
|
|
271
|
-
}
|
|
272
|
-
this._current = current;
|
|
273
|
-
}
|
|
274
|
-
let literalString = stream.slice(start, this._current).trimStart();
|
|
275
|
-
literalString = literalString.replace('\\`', '`');
|
|
276
|
-
let literal = null;
|
|
277
|
-
let ok = false;
|
|
278
|
-
// attempts to detect and parse valid JSON
|
|
279
|
-
if (this.looksLikeJSON(literalString)) {
|
|
280
|
-
[literal, ok] = this.parseJSON(literalString);
|
|
281
|
-
}
|
|
282
|
-
// invalid JSON values should be converted to quoted
|
|
283
|
-
// JSON strings during the JEP-12 deprecation period.
|
|
284
|
-
if (!ok && this._enable_legacy_literals) {
|
|
285
|
-
[literal, ok] = this.parseJSON(`"${literalString}"`);
|
|
286
|
-
}
|
|
287
|
-
if (!ok) {
|
|
288
|
-
const error = new Error(`Syntax error: unexpected end of JSON input or invalid format for a JSON literal: ${stream[this._current]}`);
|
|
289
|
-
error.name = 'LexerError';
|
|
290
|
-
throw error;
|
|
291
|
-
}
|
|
292
|
-
this._current += 1;
|
|
293
|
-
return literal;
|
|
294
|
-
}
|
|
295
|
-
looksLikeJSON(literalString) {
|
|
296
|
-
const startingChars = '[{"';
|
|
297
|
-
const jsonLiterals = ['true', 'false', 'null'];
|
|
298
|
-
const numberLooking = '-0123456789';
|
|
299
|
-
if (literalString === '') {
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
if (startingChars.includes(literalString[0])) {
|
|
303
|
-
return true;
|
|
304
|
-
}
|
|
305
|
-
if (jsonLiterals.includes(literalString)) {
|
|
306
|
-
return true;
|
|
307
|
-
}
|
|
308
|
-
if (numberLooking.includes(literalString[0])) {
|
|
309
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
310
|
-
const [_, ok] = this.parseJSON(literalString);
|
|
311
|
-
return ok;
|
|
312
|
-
}
|
|
313
|
-
return false;
|
|
314
|
-
}
|
|
315
|
-
parseJSON(text) {
|
|
316
|
-
try {
|
|
317
|
-
const json = JSON.parse(text);
|
|
318
|
-
return [json, true];
|
|
319
|
-
}
|
|
320
|
-
catch (_a) {
|
|
321
|
-
return [null, false];
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
exports.Lexer = new StreamLexer();
|
|
326
|
-
exports.default = exports.Lexer;
|
|
327
|
-
//# sourceMappingURL=Lexer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Lexer.js","sourceRoot":"","sources":["../../../src/Lexer.ts"],"names":[],"mappings":";;;AACA,6CAA+D;AAC/D,yCAA2D;AAC3D,6CAA0C;AAE7B,QAAA,WAAW,GAA0B;IAChD,GAAG,EAAE,kBAAK,CAAC,UAAU;IAC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CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE;YAC5C,OAAO,IAAI,CAAC;SACb;QACD,IAAI,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;YACxC,OAAO,IAAI,CAAC;SACb;QACD,IAAI,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE;YAC5C,gEAAgE;YAChE,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;YAC9C,OAAO,EAAE,CAAC;SACX;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,SAAS,CAAC,IAAY;QAC5B,IAAI;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC9B,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACrB;QAAC,WAAM;YACN,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SACtB;IACH,CAAC;CACF;AAEY,QAAA,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;AACvC,kBAAe,aAAK,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Token = void 0;
|
|
4
|
-
var Token;
|
|
5
|
-
(function (Token) {
|
|
6
|
-
Token["TOK_EOF"] = "EOF";
|
|
7
|
-
Token["TOK_VARIABLE"] = "Variable";
|
|
8
|
-
Token["TOK_ASSIGN"] = "Assign";
|
|
9
|
-
Token["TOK_UNQUOTEDIDENTIFIER"] = "UnquotedIdentifier";
|
|
10
|
-
Token["TOK_QUOTEDIDENTIFIER"] = "QuotedIdentifier";
|
|
11
|
-
Token["TOK_RBRACKET"] = "Rbracket";
|
|
12
|
-
Token["TOK_RPAREN"] = "Rparen";
|
|
13
|
-
Token["TOK_COMMA"] = "Comma";
|
|
14
|
-
Token["TOK_COLON"] = "Colon";
|
|
15
|
-
Token["TOK_RBRACE"] = "Rbrace";
|
|
16
|
-
Token["TOK_NUMBER"] = "Number";
|
|
17
|
-
Token["TOK_CURRENT"] = "Current";
|
|
18
|
-
Token["TOK_ROOT"] = "Root";
|
|
19
|
-
Token["TOK_EXPREF"] = "Expref";
|
|
20
|
-
Token["TOK_PIPE"] = "Pipe";
|
|
21
|
-
Token["TOK_OR"] = "Or";
|
|
22
|
-
Token["TOK_AND"] = "And";
|
|
23
|
-
Token["TOK_EQ"] = "EQ";
|
|
24
|
-
Token["TOK_GT"] = "GT";
|
|
25
|
-
Token["TOK_LT"] = "LT";
|
|
26
|
-
Token["TOK_GTE"] = "GTE";
|
|
27
|
-
Token["TOK_LTE"] = "LTE";
|
|
28
|
-
Token["TOK_NE"] = "NE";
|
|
29
|
-
Token["TOK_PLUS"] = "Plus";
|
|
30
|
-
Token["TOK_MINUS"] = "Minus";
|
|
31
|
-
Token["TOK_MULTIPLY"] = "Multiply";
|
|
32
|
-
Token["TOK_DIVIDE"] = "Divide";
|
|
33
|
-
Token["TOK_MODULO"] = "Modulo";
|
|
34
|
-
Token["TOK_DIV"] = "Div";
|
|
35
|
-
Token["TOK_FLATTEN"] = "Flatten";
|
|
36
|
-
Token["TOK_STAR"] = "Star";
|
|
37
|
-
Token["TOK_FILTER"] = "Filter";
|
|
38
|
-
Token["TOK_DOT"] = "Dot";
|
|
39
|
-
Token["TOK_NOT"] = "Not";
|
|
40
|
-
Token["TOK_LBRACE"] = "Lbrace";
|
|
41
|
-
Token["TOK_LBRACKET"] = "Lbracket";
|
|
42
|
-
Token["TOK_LPAREN"] = "Lparen";
|
|
43
|
-
Token["TOK_LITERAL"] = "Literal";
|
|
44
|
-
Token["TOK_QUESTION"] = "Question";
|
|
45
|
-
})(Token = exports.Token || (exports.Token = {}));
|
|
46
|
-
//# sourceMappingURL=Lexer.type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Lexer.type.js","sourceRoot":"","sources":["../../../src/Lexer.type.ts"],"names":[],"mappings":";;;AAEA,IAAY,KAwCX;AAxCD,WAAY,KAAK;IACf,wBAAe,CAAA;IACf,kCAAyB,CAAA;IACzB,8BAAqB,CAAA;IACrB,sDAA6C,CAAA;IAC7C,kDAAyC,CAAA;IACzC,kCAAyB,CAAA;IACzB,8BAAqB,CAAA;IACrB,4BAAmB,CAAA;IACnB,4BAAmB,CAAA;IACnB,8BAAqB,CAAA;IACrB,8BAAqB,CAAA;IACrB,gCAAuB,CAAA;IACvB,0BAAiB,CAAA;IACjB,8BAAqB,CAAA;IACrB,0BAAiB,CAAA;IACjB,sBAAa,CAAA;IACb,wBAAe,CAAA;IACf,sBAAa,CAAA;IACb,sBAAa,CAAA;IACb,sBAAa,CAAA;IACb,wBAAe,CAAA;IACf,wBAAe,CAAA;IACf,sBAAa,CAAA;IACb,0BAAiB,CAAA;IACjB,4BAAmB,CAAA;IACnB,kCAAyB,CAAA;IACzB,8BAAqB,CAAA;IACrB,8BAAqB,CAAA;IACrB,wBAAe,CAAA;IACf,gCAAuB,CAAA;IACvB,0BAAiB,CAAA;IACjB,8BAAqB,CAAA;IACrB,wBAAe,CAAA;IACf,wBAAe,CAAA;IACf,8BAAqB,CAAA;IACrB,kCAAyB,CAAA;IACzB,8BAAqB,CAAA;IACrB,gCAAuB,CAAA;IACvB,kCAAyB,CAAA;AAC3B,CAAC,EAxCW,KAAK,GAAL,aAAK,KAAL,aAAK,QAwChB"}
|