@witchcraft/expressit 0.2.2 → 0.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 +1 -2
- package/dist/Lexer.d.ts +99 -94
- package/dist/Lexer.d.ts.map +1 -1
- package/dist/Lexer.js +211 -559
- package/dist/Parser.d.ts +26 -26
- package/dist/Parser.d.ts.map +1 -1
- package/dist/Parser.js +2 -1
- package/dist/ast/builders/condition.d.ts +1 -1
- package/dist/ast/builders/condition.d.ts.map +1 -1
- package/dist/ast/builders/condition.js +1 -0
- package/dist/ast/builders/delim.d.ts +2 -2
- package/dist/ast/builders/delim.d.ts.map +1 -1
- package/dist/ast/builders/error.d.ts +2 -2
- package/dist/ast/builders/error.d.ts.map +1 -1
- package/dist/ast/builders/expression.d.ts +2 -2
- package/dist/ast/builders/expression.d.ts.map +1 -1
- package/dist/ast/builders/expression.js +2 -6
- package/dist/ast/builders/group.d.ts +1 -1
- package/dist/ast/builders/group.d.ts.map +1 -1
- package/dist/ast/builders/group.js +1 -3
- package/dist/ast/builders/pos.d.ts +2 -2
- package/dist/ast/builders/pos.d.ts.map +1 -1
- package/dist/ast/builders/token.d.ts +2 -2
- package/dist/ast/builders/token.d.ts.map +1 -1
- package/dist/ast/builders/type.d.ts +2 -2
- package/dist/ast/builders/type.d.ts.map +1 -1
- package/dist/ast/builders/variable.d.ts +3 -3
- package/dist/ast/builders/variable.d.ts.map +1 -1
- package/dist/ast/createConditionNode.d.ts +1 -1
- package/dist/ast/createConditionNode.d.ts.map +1 -1
- package/dist/ast/createGroupNode.d.ts +1 -1
- package/dist/ast/createGroupNode.d.ts.map +1 -1
- package/dist/ast/createToken.d.ts +2 -2
- package/dist/ast/createToken.d.ts.map +1 -1
- package/dist/ast/createToken.js +2 -2
- package/dist/ast/error.d.ts +2 -2
- package/dist/ast/error.d.ts.map +1 -1
- package/dist/ast/error.js +1 -0
- package/dist/ast/handlers.d.ts +23 -23
- package/dist/ast/handlers.d.ts.map +1 -1
- package/dist/ast/handlers.js +1 -1
- package/dist/examples/ParserWithSqlSupport.d.ts +5 -5
- package/dist/examples/ParserWithSqlSupport.d.ts.map +1 -1
- package/dist/examples/ParserWithSqlSupport.js +2 -0
- package/dist/index.js +2 -2
- package/dist/internal/ExpressitError.d.ts +2 -2
- package/dist/internal/ExpressitError.d.ts.map +1 -1
- package/dist/internal/checkParserOpts.js +11 -11
- package/dist/package.json.js +2 -60
- package/dist/types/ast.d.ts +60 -58
- package/dist/types/ast.d.ts.map +1 -1
- package/dist/types/ast.js +26 -27
- package/dist/types/autocomplete.d.ts +23 -21
- package/dist/types/autocomplete.d.ts.map +1 -1
- package/dist/types/autocomplete.js +24 -21
- package/dist/types/errors.d.ts +12 -10
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +8 -7
- package/dist/types/index.js +2 -2
- package/dist/types/parser.d.ts +3 -3
- package/dist/types/parser.d.ts.map +1 -1
- package/dist/utils/getCursorInfo.js +2 -0
- package/dist/utils/getOppositeDelimiter.d.ts +2 -2
- package/dist/utils/getOppositeDelimiter.d.ts.map +1 -1
- package/dist/utils/isDelimiter.d.ts +2 -2
- package/dist/utils/isDelimiter.d.ts.map +1 -1
- package/dist/utils/isParen.d.ts +2 -2
- package/dist/utils/isParen.d.ts.map +1 -1
- package/dist/utils/isQuote.d.ts +2 -2
- package/dist/utils/isQuote.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/Lexer.ts +98 -88
- package/src/Parser.ts +61 -61
- package/src/ast/builders/condition.ts +3 -3
- package/src/ast/builders/delim.ts +4 -4
- package/src/ast/builders/error.ts +3 -3
- package/src/ast/builders/expression.ts +4 -8
- package/src/ast/builders/group.ts +2 -4
- package/src/ast/builders/pos.ts +3 -3
- package/src/ast/builders/token.ts +2 -2
- package/src/ast/builders/type.ts +2 -2
- package/src/ast/builders/variable.ts +5 -5
- package/src/ast/createConditionNode.ts +2 -2
- package/src/ast/createGroupNode.ts +4 -4
- package/src/ast/createToken.ts +6 -6
- package/src/ast/error.ts +2 -2
- package/src/ast/handlers.ts +20 -20
- package/src/examples/ParserWithSqlSupport.ts +11 -5
- package/src/internal/ExpressitError.ts +3 -3
- package/src/internal/checkParserOpts.ts +11 -11
- package/src/types/ast.ts +101 -96
- package/src/types/autocomplete.ts +26 -22
- package/src/types/errors.ts +18 -13
- package/src/types/parser.ts +3 -3
- package/src/utils/getOppositeDelimiter.ts +2 -2
- package/src/utils/getSurroundingErrors.ts +4 -4
- package/src/utils/isDelimiter.ts +3 -3
- package/src/utils/isParen.ts +2 -2
- package/src/utils/isQuote.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParserWithSqlSupport.d.ts","sourceRoot":"","sources":["../../src/examples/ParserWithSqlSupport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAY,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,KAAK,QAAQ,EAAa,MAAM,iBAAiB,CAAA;AAEzH,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,kKAAkK;IAClK,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACzD;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,EAAE,CAAA;IACjE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kMAAkM;IAClM,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,2JAA2J;IAC3J,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;CAC/B;AACD,MAAM,WAAW,sBAAsB;IACtC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,C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AAG,EAAE,GAAG,CAAC;IACnE;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAChC,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,OAAO,WAAW,SAAS,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE;CA6CtF;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,CAKnF;AAED,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAC3D,EAAE,OAAe,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7C,GAAG,CAwDL"}
|
|
@@ -151,6 +151,8 @@ class ParserWithSqlSupport extends Parser {
|
|
|
151
151
|
});
|
|
152
152
|
__publicField(this, "sqlEscapeValue");
|
|
153
153
|
__publicField(this, "operatorMap");
|
|
154
|
+
__publicField(this, "propertyDefinitions");
|
|
155
|
+
__publicField(this, "operatorDefinitions");
|
|
154
156
|
this.propertyDefinitions = propertyDefinitions;
|
|
155
157
|
this.operatorDefinitions = operatorDefinitions;
|
|
156
158
|
this.operatorMap = operatorMap;
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import * as index from "./ast/index.js";
|
|
|
2
2
|
import { Parser } from "./Parser.js";
|
|
3
3
|
import { AST_TYPE, TOKEN_TYPE } from "./types/ast.js";
|
|
4
4
|
import { SUGGESTION_TYPE } from "./types/autocomplete.js";
|
|
5
|
-
import {
|
|
5
|
+
import { PARSER_ERROR } from "./types/errors.js";
|
|
6
6
|
import * as index$1 from "./utils/index.js";
|
|
7
7
|
import * as index$2 from "./defaults/index.js";
|
|
8
8
|
export {
|
|
9
9
|
AST_TYPE,
|
|
10
|
-
|
|
10
|
+
PARSER_ERROR,
|
|
11
11
|
Parser,
|
|
12
12
|
SUGGESTION_TYPE,
|
|
13
13
|
TOKEN_TYPE,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ErrorInfo, ParserError } from "../types/errors.js";
|
|
2
2
|
/** @internal */
|
|
3
|
-
export declare class ExpressitError<T extends
|
|
3
|
+
export declare class ExpressitError<T extends ParserError> extends Error {
|
|
4
4
|
version: string;
|
|
5
5
|
repo: string;
|
|
6
6
|
type: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressitError.d.ts","sourceRoot":"","sources":["../../src/internal/ExpressitError.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ExpressitError.d.ts","sourceRoot":"","sources":["../../src/internal/ExpressitError.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhE,gBAAgB;AAChB,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,KAAK;IAC/D,OAAO,EAAE,MAAM,CAAU;IAEzB,IAAI,EAAE,MAAM,CAAa;IAEzB,IAAI,EAAE,CAAC,CAAA;IAEP,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;gBAEN,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;CAYzD"}
|
|
@@ -3,7 +3,7 @@ import { pushIfNotIn } from "@alanscodelog/utils/pushIfNotIn.js";
|
|
|
3
3
|
import { ExpressitError } from "./ExpressitError.js";
|
|
4
4
|
import { defaultConditionNormalizer } from "../defaults/defaultConditionNormalizer.js";
|
|
5
5
|
import { defaultValueComparer } from "../defaults/defaultValueComparer.js";
|
|
6
|
-
import {
|
|
6
|
+
import { PARSER_ERROR } from "../types/errors.js";
|
|
7
7
|
function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false) {
|
|
8
8
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9
9
|
if (!evaluatorChecks) {
|
|
@@ -20,7 +20,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
20
20
|
if (opts.customPropertyOperators) pushIfNotIn(extra, opts.customPropertyOperators);
|
|
21
21
|
if (opts.expandedPropertySeparator && isBlank(opts.expandedPropertySeparator)) {
|
|
22
22
|
throw new ExpressitError(
|
|
23
|
-
|
|
23
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
24
24
|
{ prohibited: [""], invalid: opts.expandedPropertySeparator },
|
|
25
25
|
`expandedPropertySeparator cannot be blank`
|
|
26
26
|
);
|
|
@@ -28,7 +28,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
28
28
|
const customInvalid = (_a = opts.customPropertyOperators) == null ? void 0 : _a.find((_) => isBlank(_));
|
|
29
29
|
if (customInvalid !== void 0) {
|
|
30
30
|
throw new ExpressitError(
|
|
31
|
-
|
|
31
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
32
32
|
{ prohibited: [""], invalid: customInvalid },
|
|
33
33
|
`customPropertyOperators cannot contain blank entries`
|
|
34
34
|
);
|
|
@@ -36,7 +36,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
36
36
|
const prefixInvalid = (_b = opts.prefixableStrings) == null ? void 0 : _b.find((_) => isBlank(_));
|
|
37
37
|
if (prefixInvalid !== void 0) {
|
|
38
38
|
throw new ExpressitError(
|
|
39
|
-
|
|
39
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
40
40
|
{ prohibited: [""], invalid: prefixInvalid },
|
|
41
41
|
`prefixableStrings cannot contain blank entries`
|
|
42
42
|
);
|
|
@@ -45,7 +45,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
45
45
|
const invalid = (_d = (_c = opts.keywords[key]) == null ? void 0 : _c.find((_) => isBlank(_.value))) == null ? void 0 : _d.value;
|
|
46
46
|
if (invalid !== void 0) {
|
|
47
47
|
throw new ExpressitError(
|
|
48
|
-
|
|
48
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
49
49
|
{ prohibited: [""], invalid },
|
|
50
50
|
`keywords.${key} cannot contain entries with blank values`
|
|
51
51
|
);
|
|
@@ -58,7 +58,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
58
58
|
const invalidPrefixableString = (_e = opts.prefixableStrings) == null ? void 0 : _e.find((val) => all.includes(val));
|
|
59
59
|
if (invalidPrefixableString) {
|
|
60
60
|
throw new ExpressitError(
|
|
61
|
-
|
|
61
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
62
62
|
{ prohibited: all, invalid: invalidPrefixableString },
|
|
63
63
|
`prefixableStrings ${messageInvalidAny} "${invalidPrefixableString}"`
|
|
64
64
|
);
|
|
@@ -66,7 +66,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
66
66
|
const invalidExpandedPropertySeparator = allKeywords.find((_) => _ === opts.expandedPropertySeparator);
|
|
67
67
|
if (invalidExpandedPropertySeparator) {
|
|
68
68
|
throw new ExpressitError(
|
|
69
|
-
|
|
69
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
70
70
|
{ prohibited: allKeywords, invalid: invalidExpandedPropertySeparator },
|
|
71
71
|
`expandedPropertySeparator ${messageInvalidBool} "${invalidExpandedPropertySeparator}"`
|
|
72
72
|
);
|
|
@@ -74,7 +74,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
74
74
|
const invalidCustomPropertyOperator = ((_f = opts.customPropertyOperators) == null ? void 0 : _f.find((val) => keywords.includes(val))) ? opts.expandedPropertySeparator : void 0;
|
|
75
75
|
if (invalidCustomPropertyOperator) {
|
|
76
76
|
throw new ExpressitError(
|
|
77
|
-
|
|
77
|
+
PARSER_ERROR.CONFLICTING_OPTIONS_ERROR,
|
|
78
78
|
{ prohibited: keywords, invalid: invalidCustomPropertyOperator },
|
|
79
79
|
`customPropertyOperator ${messageInvalidBool} "${invalidCustomPropertyOperator}"`
|
|
80
80
|
);
|
|
@@ -88,7 +88,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
88
88
|
if (opts.regexValues) requireCustomNormalizer.push("regexValues");
|
|
89
89
|
if (requireCustomNormalizer.length > 0 && opts.conditionNormalizer === defaultConditionNormalizer) {
|
|
90
90
|
throw new ExpressitError(
|
|
91
|
-
|
|
91
|
+
PARSER_ERROR.OPTION_REQUIRED_ERROR,
|
|
92
92
|
{ options: requireCustomNormalizer, requires: "conditionNormalizer" },
|
|
93
93
|
`A custom conditionNormalizer function must be specified when using the following options: ${requireCustomNormalizer.join(", ")}`
|
|
94
94
|
);
|
|
@@ -98,7 +98,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
98
98
|
if (opts.regexValues) requireCustomComparer.push("arrayValues");
|
|
99
99
|
if (requireCustomComparer.length > 0 && opts.valueComparer === defaultValueComparer) {
|
|
100
100
|
throw new ExpressitError(
|
|
101
|
-
|
|
101
|
+
PARSER_ERROR.OPTION_REQUIRED_ERROR,
|
|
102
102
|
{ options: requireCustomComparer, requires: "valueComparer" },
|
|
103
103
|
`A custom valueComparer function must be specified when using the following options: ${requireCustomComparer.join(", ")}`
|
|
104
104
|
);
|
|
@@ -107,7 +107,7 @@ function checkParserOpts(opts, evaluatorChecks = false, validatorChecks = false)
|
|
|
107
107
|
if (validatorChecks) {
|
|
108
108
|
if (opts.valueValidator === void 0) {
|
|
109
109
|
throw new ExpressitError(
|
|
110
|
-
|
|
110
|
+
PARSER_ERROR.OPTION_REQUIRED_ERROR,
|
|
111
111
|
{ requires: "valueValidator" },
|
|
112
112
|
`A custom valueValidator function must be specified when using the validate method.`
|
|
113
113
|
);
|
package/dist/package.json.js
CHANGED
|
@@ -1,69 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
const description = "A blazing fast, customizable, error-tolerant expression parser that creates safe to eval expressions + a few other goodies like autocomplete.";
|
|
3
|
-
const version = "0.2.2";
|
|
4
|
-
const types = "./dist/index.d.ts";
|
|
5
|
-
const type = "module";
|
|
6
|
-
const module = "./dist/index.js";
|
|
7
|
-
const sideEffects = false;
|
|
8
|
-
const exports = { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" }, "./ast": { "types": "./dist/ast/index.d.ts", "import": "./dist/ast/index.js" }, "./ast/*": { "types": "./dist/ast/*", "import": "./dist/ast/*" }, "./internal": { "types": "./dist/internal/index.d.ts", "import": "./dist/internal/index.js" }, "./internal/*": { "types": "./dist/internal/*", "import": "./dist/internal/*" }, "./methods": { "types": "./dist/methods/index.d.ts", "import": "./dist/methods/index.js" }, "./methods/*": { "types": "./dist/methods/*", "import": "./dist/methods/*" }, "./utils": { "types": "./dist/utils/index.d.ts", "import": "./dist/utils/index.js" }, "./utils/*": { "types": "./dist/utils/*", "import": "./dist/utils/*" }, "./examples": { "types": "./dist/examples/index.d.ts", "import": "./dist/examples/index.js" }, "./examples/*": { "types": "./dist/examples/*", "import": "./dist/examples/*" }, "./*": { "types": "./dist/types/*", "import": "./dist/types/*" } };
|
|
9
|
-
const scripts = { "debug": "ts-node -r tsconfig-paths/register -T --esm", "build": "vite build", "build:dev": "vite build --mode development", "build:watch": "vite build --watch --mode production", "build:types": "tsc --emitDeclarationOnly -p tsconfig.types.json", "lint:eslint": 'eslint "{src,tests,bin}/**/*.{cjs,js,ts}" "*.{cjs,js,ts}" --max-warnings=1 --report-unused-disable-directives', "lint:types": "tsc --noEmit --pretty", "lint:commits": "commitlint --from $(git rev-list --max-parents=0 HEAD) --to HEAD --verbose", "lint:imports": "madge --circular --extensions ts ./src", "lint": "npm run lint:types && npm run lint:eslint", "coverage": "vitest --exclude '.direnv/**/*' --coverage", "coverage:dev": "vitest --exclude '.direnv/**/*' --watch --coverage", "test:db": "rm -rf ./tests/db/migrations && pnpm drizzle-kit generate --config ./tests/db/drizzle.config.ts", "test": "pnpm test:db && npm run lint:types && vitest run --exclude '.direnv/**/*'", "test:watch": "pnpm test:db && vitest --watch --exclude '.direnv/**/*'", "test:inspect-errors": "cross-env INSPECT_ERRORS=true npm run test", "doc": "typedoc --options typedoc.config.js", "doc:watch": 'onchange -i "src/**/*.ts" "typedoc.config.cjs" -- npm run doc', "doc:serve": "http-server docs --port=5001", "doc:dev": 'concurrently "npm run doc:watch" "npm run doc:serve"', "doc:check-invalid": "typedoc --options typedoc.config.cjs --listInvalidSymbolLinks", "demo:dev": 'cd demo && concurrently "vite" "npm run build:watch"', "demo:build": "cd demo && npm run build", "actions:debug": "act -r -v -j release", "gen:exports": "indexit update -o '${path}.js' -i **/*.d.ts", "prepare": "husky && npm run build" };
|
|
10
|
-
const dependencies = { "@alanscodelog/utils": "^4.0.0" };
|
|
11
|
-
const devDependencies = { "@alanscodelog/commitlint-config": "^3.0.1", "@alanscodelog/eslint-config": "5.0.3", "@alanscodelog/semantic-release-config": "^5.0.3", "@alanscodelog/tsconfigs": "^5.0.1", "@commitlint/cli": "^19.6.1", "@electric-sql/pglite": "^0.2.12", "@types/node": "^22.10.2", "@vitest/coverage-v8": "^2.1.8", "concurrently": "^9.1.0", "cross-env": "^7.0.3", "drizzle-kit": "^0.30.1", "drizzle-orm": "^0.38.2", "fast-glob": "^3.3.1", "http-server": "^14.1.1", "husky": "^9.1.7", "indexit": "2.1.0-beta.3", "madge": "^8.0.0", "onchange": "^7.1.0", "semantic-release": "^24.2.0", "ts-node": "^10.9.1", "typedoc": "0.27.5", "typescript": "~5.7.2", "vite": "^6.0.2", "vite-plugin-externalize-deps": "^0.8.0", "vite-tsconfig-paths": "^5.1.4", "vitest": "^2.1.8" };
|
|
12
|
-
const author = "Alan <alanscodelog@gmail.com>";
|
|
1
|
+
const version = "0.3.0";
|
|
13
2
|
const repository = "https://github.com/witchcraftjs/expressit";
|
|
14
|
-
const keywords = ["boolean", "parser", "query", "evaluator", "expression", "condition", "search"];
|
|
15
|
-
const license = "MIT";
|
|
16
|
-
const files = ["src", "dist"];
|
|
17
|
-
const release = { "extends": ["@alanscodelog/semantic-release-config"] };
|
|
18
|
-
const commitlint = { "extends": ["@alanscodelog"] };
|
|
19
|
-
const browserslist = "defaults and supports es6-module,maintained node versions";
|
|
20
|
-
const engines = { "node": ">=18.0.0" };
|
|
21
|
-
const publishConfig = { "access": "public" };
|
|
22
3
|
const packageJson = {
|
|
23
|
-
name,
|
|
24
|
-
description,
|
|
25
4
|
version,
|
|
26
|
-
|
|
27
|
-
type,
|
|
28
|
-
module,
|
|
29
|
-
sideEffects,
|
|
30
|
-
exports,
|
|
31
|
-
scripts,
|
|
32
|
-
dependencies,
|
|
33
|
-
devDependencies,
|
|
34
|
-
author,
|
|
35
|
-
repository,
|
|
36
|
-
keywords,
|
|
37
|
-
license,
|
|
38
|
-
files,
|
|
39
|
-
release,
|
|
40
|
-
commitlint,
|
|
41
|
-
browserslist,
|
|
42
|
-
engines,
|
|
43
|
-
"@comments": { "scripts": { "test": "Runs `lint:types` before (so that flags can be passed to the test command) so that we can test type assertions. See expect_type function in @alanscodelog/utils.", "lint:commits": "Lints all unpushed commits in the active branch.", "prepare": "Needed so that if we pull the package from git it will get built and installed properly.", "actions:debug": "For debugging github build action locally with nektos/act. Requires act and docker. Note: Cache will never work locally because of https://github.com/nektos/act/issues/285" } },
|
|
44
|
-
publishConfig
|
|
5
|
+
repository
|
|
45
6
|
};
|
|
46
7
|
export {
|
|
47
|
-
author,
|
|
48
|
-
browserslist,
|
|
49
|
-
commitlint,
|
|
50
8
|
packageJson as default,
|
|
51
|
-
dependencies,
|
|
52
|
-
description,
|
|
53
|
-
devDependencies,
|
|
54
|
-
engines,
|
|
55
|
-
exports,
|
|
56
|
-
files,
|
|
57
|
-
keywords,
|
|
58
|
-
license,
|
|
59
|
-
module,
|
|
60
|
-
name,
|
|
61
|
-
publishConfig,
|
|
62
|
-
release,
|
|
63
9
|
repository,
|
|
64
|
-
scripts,
|
|
65
|
-
sideEffects,
|
|
66
|
-
type,
|
|
67
|
-
types,
|
|
68
10
|
version
|
|
69
11
|
};
|
package/dist/types/ast.d.ts
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
import type { AnyFunction } from "@alanscodelog/utils/types";
|
|
1
|
+
import type { AnyFunction, EnumLike } from "@alanscodelog/utils/types";
|
|
2
2
|
export type AddParameters<T extends AnyFunction, TExtra extends any[] = [boolean]> = (...args: [...Parameters<T>, ...TExtra]) => ReturnType<T>;
|
|
3
|
-
export declare
|
|
4
|
-
VALUE
|
|
5
|
-
AND
|
|
6
|
-
OR
|
|
7
|
-
NOT
|
|
8
|
-
BACKTICK
|
|
9
|
-
SINGLEQUOTE
|
|
10
|
-
DOUBLEQUOTE
|
|
11
|
-
PARENL
|
|
12
|
-
PARENR
|
|
13
|
-
BRACKETL
|
|
14
|
-
BRACKETR
|
|
15
|
-
OP_EXPANDED_SEP
|
|
16
|
-
OP_CUSTOM
|
|
17
|
-
REGEX
|
|
18
|
-
}
|
|
3
|
+
export declare const TOKEN_TYPE: {
|
|
4
|
+
VALUE: "VALUE";
|
|
5
|
+
AND: "AND";
|
|
6
|
+
OR: "OR";
|
|
7
|
+
NOT: "NOT";
|
|
8
|
+
BACKTICK: "BACKTICK";
|
|
9
|
+
SINGLEQUOTE: "SINGLEQUOTE";
|
|
10
|
+
DOUBLEQUOTE: "DOUBLEQUOTE";
|
|
11
|
+
PARENL: "PARENL";
|
|
12
|
+
PARENR: "PARENR";
|
|
13
|
+
BRACKETL: "BRACKETL";
|
|
14
|
+
BRACKETR: "BRACKETR";
|
|
15
|
+
OP_EXPANDED_SEP: "OP_EXPANDED_SEP";
|
|
16
|
+
OP_CUSTOM: "OP_CUSTOM";
|
|
17
|
+
REGEX: "REGEX";
|
|
18
|
+
};
|
|
19
|
+
export type TokenType = EnumLike<typeof TOKEN_TYPE>;
|
|
19
20
|
/**
|
|
20
21
|
* @internal
|
|
21
22
|
* Note if the negation operator, `!`, is used as a propertyOperator, this will return the wrong type.
|
|
22
23
|
*/
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type TokenBracketTypes = TOKEN_TYPE.BRACKETL | TOKEN_TYPE.BRACKETR;
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
24
|
+
export type ExtractToken<T extends string> = T extends "`" ? typeof TOKEN_TYPE.BACKTICK : T extends `'` ? typeof TOKEN_TYPE.SINGLEQUOTE : T extends `"` ? typeof TOKEN_TYPE.DOUBLEQUOTE : T extends `/` ? typeof TOKEN_TYPE.REGEX : T extends `(` ? typeof TOKEN_TYPE.PARENL : T extends `)` ? typeof TOKEN_TYPE.PARENR : T extends `[` ? typeof TOKEN_TYPE.BRACKETL : T extends `]` ? typeof TOKEN_TYPE.BRACKETR : T extends `and` ? typeof TOKEN_TYPE.AND : T extends `&&` ? typeof TOKEN_TYPE.AND : T extends `&` ? typeof TOKEN_TYPE.AND : T extends `or` ? typeof TOKEN_TYPE.OR : T extends `||` ? typeof TOKEN_TYPE.OR : T extends `|` ? typeof TOKEN_TYPE.OR : T extends `not` ? typeof TOKEN_TYPE.NOT : T extends `!` ? typeof TOKEN_TYPE.NOT : typeof TOKEN_TYPE.VALUE;
|
|
25
|
+
export type TokenParen = typeof TOKEN_TYPE.PARENL | typeof TOKEN_TYPE.PARENR;
|
|
26
|
+
export type TokenBracketTypes = typeof TOKEN_TYPE.BRACKETL | typeof TOKEN_TYPE.BRACKETR;
|
|
27
|
+
export type TokenDelimiter = TokenParen | TokenQuote | TokenBracketTypes | typeof TOKEN_TYPE.OP_EXPANDED_SEP;
|
|
28
|
+
export type TokenQuote = typeof TOKEN_TYPE.BACKTICK | typeof TOKEN_TYPE.SINGLEQUOTE | typeof TOKEN_TYPE.DOUBLEQUOTE | typeof TOKEN_TYPE.REGEX;
|
|
29
|
+
export type TokenBoolean = typeof TOKEN_TYPE.AND | typeof TOKEN_TYPE.OR;
|
|
30
|
+
export type TokenOperator = TokenBoolean | typeof TOKEN_TYPE.NOT;
|
|
31
|
+
export type TokenPropertyOperator = typeof TOKEN_TYPE.OP_CUSTOM | typeof TOKEN_TYPE.OP_EXPANDED_SEP;
|
|
31
32
|
export type EmptyObj = Record<any, never>;
|
|
32
33
|
export type FirstParam<T extends AnyFunction> = Parameters<T>["0"];
|
|
33
34
|
export type Position = {
|
|
34
35
|
start: number;
|
|
35
36
|
end: number;
|
|
36
37
|
};
|
|
37
|
-
export declare
|
|
38
|
-
EXPRESSION
|
|
39
|
-
NORMALIZED_EXPRESSION
|
|
40
|
-
GROUP
|
|
41
|
-
ARRAY
|
|
42
|
-
CONDITION
|
|
43
|
-
NORMALIZED_CONDITION
|
|
44
|
-
VARIABLE
|
|
45
|
-
}
|
|
38
|
+
export declare const AST_TYPE: {
|
|
39
|
+
EXPRESSION: "EXPRESSION";
|
|
40
|
+
NORMALIZED_EXPRESSION: "NORMALIZED_EXPRESSION";
|
|
41
|
+
GROUP: "GROUP";
|
|
42
|
+
ARRAY: "ARRAY";
|
|
43
|
+
CONDITION: "CONDITION";
|
|
44
|
+
NORMALIZED_CONDITION: "NORMALIZED_CONDITION";
|
|
45
|
+
VARIABLE: "VARIABLE";
|
|
46
|
+
};
|
|
47
|
+
export type AstType = EnumLike<typeof AST_TYPE>;
|
|
46
48
|
export type RawNode<T extends Node> = Omit<T, "valid" | "type" | "isNode">;
|
|
47
49
|
/**
|
|
48
50
|
* The base type from which {@link ValidToken} and {@link ErrorToken} extend.
|
|
@@ -58,7 +60,7 @@ export interface BaseToken {
|
|
|
58
60
|
/**
|
|
59
61
|
* Valid tokens always have a value, even if it might be an empty string.
|
|
60
62
|
*/
|
|
61
|
-
export interface ValidToken<TType extends
|
|
63
|
+
export interface ValidToken<TType extends TokenType = TokenType> extends BaseToken {
|
|
62
64
|
valid: true;
|
|
63
65
|
type: TType;
|
|
64
66
|
value: string;
|
|
@@ -78,20 +80,20 @@ export interface ErrorToken extends BaseToken {
|
|
|
78
80
|
type?: undefined;
|
|
79
81
|
value?: undefined;
|
|
80
82
|
valid: false;
|
|
81
|
-
expected:
|
|
83
|
+
expected: TokenType[];
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* For more easily typing tokens that might or might not be valid.
|
|
85
87
|
*
|
|
86
88
|
* Using {@link Token} does not work well in certain situations and is also more complex because it has so many generics.
|
|
87
89
|
*/
|
|
88
|
-
export type AnyToken<TType extends
|
|
90
|
+
export type AnyToken<TType extends TokenType = TokenType> = ValidToken<TType> | ErrorToken;
|
|
89
91
|
export type RawToken<T extends AnyToken> = Omit<T, "isToken" | "valid">;
|
|
90
92
|
export type ParserResults = ExpressionNode | ConditionNode | GroupNode | ErrorToken;
|
|
91
93
|
/**
|
|
92
94
|
* The base AST type all node types extend from.
|
|
93
95
|
*/
|
|
94
|
-
export interface Node<TType extends
|
|
96
|
+
export interface Node<TType extends AstType = AstType, TValid extends boolean = boolean> {
|
|
95
97
|
isNode: true;
|
|
96
98
|
type: TType;
|
|
97
99
|
start: number;
|
|
@@ -128,7 +130,7 @@ export interface Node<TType extends AST_TYPE = AST_TYPE, TValid extends boolean
|
|
|
128
130
|
* ^ prefix: STILL a "not" Token
|
|
129
131
|
* ```
|
|
130
132
|
*/
|
|
131
|
-
export interface GroupNode<TValid extends boolean = boolean, TPrefixable extends boolean = true, TPrefix extends TPrefixable extends true ? ConditionNode<TValid> | ValidToken<TOKEN_TYPE.NOT> | undefined : ValidToken<TOKEN_TYPE.NOT> | undefined = TPrefixable extends true ? ConditionNode<TValid> | ValidToken<TOKEN_TYPE.NOT> | undefined : ValidToken<TOKEN_TYPE.NOT>> extends Node<AST_TYPE.GROUP> {
|
|
133
|
+
export interface GroupNode<TValid extends boolean = boolean, TPrefixable extends boolean = true, TPrefix extends TPrefixable extends true ? ConditionNode<TValid> | ValidToken<typeof TOKEN_TYPE.NOT> | undefined : ValidToken<typeof TOKEN_TYPE.NOT> | undefined = TPrefixable extends true ? ConditionNode<TValid> | ValidToken<typeof TOKEN_TYPE.NOT> | undefined : ValidToken<typeof TOKEN_TYPE.NOT>> extends Node<typeof AST_TYPE.GROUP> {
|
|
132
134
|
/**
|
|
133
135
|
* If the condition is negated this will contain a "not" **token**, {@link ValidToken} .
|
|
134
136
|
*
|
|
@@ -143,7 +145,7 @@ export interface GroupNode<TValid extends boolean = boolean, TPrefixable extends
|
|
|
143
145
|
/**
|
|
144
146
|
* The parenthesis tokens, {@link ValidToken} . These will always be defined (although not necessarily with valid tokens).
|
|
145
147
|
*/
|
|
146
|
-
paren: NodeDelimiters<TOKEN_TYPE.PARENL, TOKEN_TYPE.PARENR>;
|
|
148
|
+
paren: NodeDelimiters<typeof TOKEN_TYPE.PARENL, typeof TOKEN_TYPE.PARENR>;
|
|
147
149
|
}
|
|
148
150
|
/**
|
|
149
151
|
* A variable represents **just** a string value (NOT it's boolean value).
|
|
@@ -156,13 +158,13 @@ export interface GroupNode<TValid extends boolean = boolean, TPrefixable extends
|
|
|
156
158
|
*
|
|
157
159
|
* If `prefixableStrings` is true, the `prefix` property might contain a value token.
|
|
158
160
|
*/
|
|
159
|
-
export interface VariableNode<TValid extends boolean = boolean> extends Node<AST_TYPE.VARIABLE, TValid> {
|
|
160
|
-
value: TValid extends boolean ? AnyToken<TOKEN_TYPE.VALUE> : TValid extends true ? ValidToken<TOKEN_TYPE.VALUE> : ErrorToken;
|
|
161
|
-
prefix?: ValidToken<TOKEN_TYPE.VALUE>;
|
|
162
|
-
quote?: NodeDelimiters<
|
|
161
|
+
export interface VariableNode<TValid extends boolean = boolean> extends Node<typeof AST_TYPE.VARIABLE, TValid> {
|
|
162
|
+
value: TValid extends boolean ? AnyToken<typeof TOKEN_TYPE.VALUE> : TValid extends true ? ValidToken<typeof TOKEN_TYPE.VALUE> : ErrorToken;
|
|
163
|
+
prefix?: ValidToken<typeof TOKEN_TYPE.VALUE>;
|
|
164
|
+
quote?: NodeDelimiters<TokenQuote, TokenQuote>;
|
|
163
165
|
}
|
|
164
|
-
export interface ExpressionNode<TValid extends boolean = boolean> extends Node<AST_TYPE.EXPRESSION> {
|
|
165
|
-
operator: AnyToken<
|
|
166
|
+
export interface ExpressionNode<TValid extends boolean = boolean> extends Node<typeof AST_TYPE.EXPRESSION> {
|
|
167
|
+
operator: AnyToken<TokenBoolean>;
|
|
166
168
|
left: ExpressionNode<TValid> | ConditionNode<TValid> | GroupNode<TValid> | (TValid extends false ? ErrorToken : never);
|
|
167
169
|
right: ExpressionNode<TValid> | ConditionNode<TValid> | GroupNode<TValid> | (TValid extends false ? ErrorToken : never);
|
|
168
170
|
}
|
|
@@ -172,15 +174,15 @@ export type Nodes = ExpressionNode | ConditionNode | GroupNode | VariableNode |
|
|
|
172
174
|
*
|
|
173
175
|
* These are usually not important for evaluating an expression but are useful for syntax highlighting.
|
|
174
176
|
*/
|
|
175
|
-
export type NodeDelimiters<TLEFT extends
|
|
177
|
+
export type NodeDelimiters<TLEFT extends TokenType, TRIGHT extends TokenType = TLEFT> = {
|
|
176
178
|
left: AnyToken<TLEFT>;
|
|
177
179
|
right: AnyToken<TRIGHT>;
|
|
178
180
|
/** Only exists if regexes are enabled and this is a regex value. */
|
|
179
|
-
flags?: ValidToken<TOKEN_TYPE.VALUE>;
|
|
181
|
+
flags?: ValidToken<typeof TOKEN_TYPE.VALUE>;
|
|
180
182
|
};
|
|
181
|
-
export interface ArrayNode<TValid extends boolean = boolean> extends Node<AST_TYPE.ARRAY> {
|
|
183
|
+
export interface ArrayNode<TValid extends boolean = boolean> extends Node<typeof AST_TYPE.ARRAY> {
|
|
182
184
|
values: VariableNode[];
|
|
183
|
-
bracket: NodeDelimiters<TOKEN_TYPE.BRACKETL, TOKEN_TYPE.BRACKETR>;
|
|
185
|
+
bracket: NodeDelimiters<typeof TOKEN_TYPE.BRACKETL, typeof TOKEN_TYPE.BRACKETR>;
|
|
184
186
|
valid: TValid;
|
|
185
187
|
}
|
|
186
188
|
/**
|
|
@@ -189,7 +191,7 @@ export interface ArrayNode<TValid extends boolean = boolean> extends Node<AST_TY
|
|
|
189
191
|
* The `value` property refers to the boolean value of the condition (not to the string value of the variable). See the `operator` property.
|
|
190
192
|
*
|
|
191
193
|
*/
|
|
192
|
-
export interface ConditionNode<TValid extends boolean = boolean> extends Node<AST_TYPE.CONDITION> {
|
|
194
|
+
export interface ConditionNode<TValid extends boolean = boolean> extends Node<typeof AST_TYPE.CONDITION> {
|
|
193
195
|
/**
|
|
194
196
|
* Contains a value node which could be a variable, an array node (if enabled), or a group.
|
|
195
197
|
*
|
|
@@ -201,7 +203,7 @@ export interface ConditionNode<TValid extends boolean = boolean> extends Node<AS
|
|
|
201
203
|
/**
|
|
202
204
|
* If the condition was negated, contains the "not" token, {@link ValidToken} , the condition was negated with.
|
|
203
205
|
*/
|
|
204
|
-
operator?: ValidToken<TOKEN_TYPE.NOT>;
|
|
206
|
+
operator?: ValidToken<typeof TOKEN_TYPE.NOT>;
|
|
205
207
|
/**
|
|
206
208
|
* If condition property operators are used, this will contain the property (as a variable), or an error token if it was missing (but some separator or operator was passed).
|
|
207
209
|
*
|
|
@@ -219,7 +221,7 @@ export interface ConditionNode<TValid extends boolean = boolean> extends Node<AS
|
|
|
219
221
|
*
|
|
220
222
|
* See the corresponding {@link ParserOptions} for more details.
|
|
221
223
|
*/
|
|
222
|
-
propertyOperator?: AnyToken<TOKEN_TYPE.OP_CUSTOM | TOKEN_TYPE.VALUE>;
|
|
224
|
+
propertyOperator?: AnyToken<typeof TOKEN_TYPE.OP_CUSTOM | typeof TOKEN_TYPE.VALUE>;
|
|
223
225
|
/**
|
|
224
226
|
* If "long/expanded" form condition property operators are used, this will contain the separators, otherwise it is undefined.
|
|
225
227
|
*
|
|
@@ -232,22 +234,22 @@ export interface ConditionNode<TValid extends boolean = boolean> extends Node<AS
|
|
|
232
234
|
* See the corresponding {@link ParserOptions} for more details.
|
|
233
235
|
*/
|
|
234
236
|
sep?: {
|
|
235
|
-
left?: AnyToken<TOKEN_TYPE.OP_EXPANDED_SEP>;
|
|
236
|
-
right?: AnyToken<TOKEN_TYPE.OP_EXPANDED_SEP>;
|
|
237
|
+
left?: AnyToken<typeof TOKEN_TYPE.OP_EXPANDED_SEP>;
|
|
238
|
+
right?: AnyToken<typeof TOKEN_TYPE.OP_EXPANDED_SEP>;
|
|
237
239
|
};
|
|
238
240
|
}
|
|
239
241
|
export interface NormalizedCondition<TOp extends string = string, TValue = any> {
|
|
240
|
-
type: AST_TYPE.NORMALIZED_CONDITION;
|
|
242
|
+
type: typeof AST_TYPE.NORMALIZED_CONDITION;
|
|
241
243
|
value: TValue;
|
|
242
244
|
operator?: TOp;
|
|
243
245
|
property: string[];
|
|
244
246
|
negate: boolean;
|
|
245
247
|
}
|
|
246
248
|
export interface NormalizedExpression<TType extends string = string, TValue = any> {
|
|
247
|
-
type: AST_TYPE.NORMALIZED_EXPRESSION;
|
|
249
|
+
type: typeof AST_TYPE.NORMALIZED_EXPRESSION;
|
|
248
250
|
left: NormalizedExpression<TType, TValue> | NormalizedCondition<TType, TValue>;
|
|
249
251
|
right: NormalizedExpression<TType, TValue> | NormalizedCondition<TType, TValue>;
|
|
250
|
-
operator:
|
|
252
|
+
operator: TokenBoolean;
|
|
251
253
|
}
|
|
252
254
|
export type ParentTypes<T extends Node | BaseToken | undefined> = T extends ValidToken ? VariableNode | GroupNode | ExpressionNode | ArrayNode | ConditionNode : T extends ErrorToken ? VariableNode | GroupNode | ExpressionNode | ArrayNode | ConditionNode : T extends GroupNode ? ExpressionNode | GroupNode | undefined : T extends VariableNode ? ConditionNode | ArrayNode | undefined : T extends ExpressionNode ? GroupNode | ExpressionNode | undefined : T extends ArrayNode ? ConditionNode | undefined : T extends ConditionNode | ExpressionNode ? GroupNode | undefined : T extends undefined ? undefined : never;
|
|
253
255
|
//# sourceMappingURL=ast.d.ts.map
|
package/dist/types/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/types/ast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/types/ast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAGtE,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;AAE9I,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAerB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAEnD;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IACxC,CAAC,SAAS,GAAG,GACX,OAAO,UAAU,CAAC,QAAQ,GAC1B,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,WAAW,GAC7B,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,WAAW,GAC7B,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,KAAK,GACvB,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,MAAM,GACxB,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,MAAM,GACxB,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,QAAQ,GAC1B,CAAC,SAAS,GAAG,GACb,OAAO,UAAU,CAAC,QAAQ,GAC1B,CAAC,SAAS,KAAK,GACf,OAAO,UAAU,CAAC,GAAG,GACrB,CAAC,SAAS,IAAI,GACd,OAAO,UAAU,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
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(AST_TYPE || {});
|
|
1
|
+
import { enumFromArray } from "@alanscodelog/utils/enumFromArray.js";
|
|
2
|
+
const TOKEN_TYPE = enumFromArray([
|
|
3
|
+
"VALUE",
|
|
4
|
+
"AND",
|
|
5
|
+
"OR",
|
|
6
|
+
"NOT",
|
|
7
|
+
"BACKTICK",
|
|
8
|
+
"SINGLEQUOTE",
|
|
9
|
+
"DOUBLEQUOTE",
|
|
10
|
+
"PARENL",
|
|
11
|
+
"PARENR",
|
|
12
|
+
"BRACKETL",
|
|
13
|
+
"BRACKETR",
|
|
14
|
+
"OP_EXPANDED_SEP",
|
|
15
|
+
"OP_CUSTOM",
|
|
16
|
+
"REGEX"
|
|
17
|
+
]);
|
|
18
|
+
const AST_TYPE = enumFromArray([
|
|
19
|
+
"EXPRESSION",
|
|
20
|
+
"NORMALIZED_EXPRESSION",
|
|
21
|
+
"GROUP",
|
|
22
|
+
"ARRAY",
|
|
23
|
+
"CONDITION",
|
|
24
|
+
"NORMALIZED_CONDITION",
|
|
25
|
+
"VARIABLE"
|
|
26
|
+
]);
|
|
28
27
|
export {
|
|
29
28
|
AST_TYPE,
|
|
30
29
|
TOKEN_TYPE
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EnumLike } from "@alanscodelog/utils";
|
|
1
2
|
import type { AnyToken, Position, ValidToken } from "./ast.js";
|
|
2
3
|
/**
|
|
3
4
|
* Contains information regarding the tokens around a cursor position. Mostly for internally use by {@link autosuggest}.
|
|
@@ -79,31 +80,32 @@ export type CursorInfo = {
|
|
|
79
80
|
prev: boolean;
|
|
80
81
|
};
|
|
81
82
|
};
|
|
82
|
-
export declare
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
REGEX_FLAGS
|
|
101
|
-
}
|
|
83
|
+
export declare const SUGGESTION_TYPE: {
|
|
84
|
+
VALUE: "VALUE";
|
|
85
|
+
BACKTICK: "BACKTICK";
|
|
86
|
+
SINGLEQUOTE: "SINGLEQUOTE";
|
|
87
|
+
DOUBLEQUOTE: "DOUBLEQUOTE";
|
|
88
|
+
PARENL: "PARENL";
|
|
89
|
+
PARENR: "PARENR";
|
|
90
|
+
REGEX: "REGEX";
|
|
91
|
+
VARIABLE: "VARIABLE";
|
|
92
|
+
ARRAY_VALUE: "ARRAY_VALUE";
|
|
93
|
+
PREFIX: "PREFIX";
|
|
94
|
+
BOOLEAN_WORD_OP: "BOOLEAN_WORD_OP";
|
|
95
|
+
BOOLEAN_SYMBOL_OP: "BOOLEAN_SYMBOL_OP";
|
|
96
|
+
PROPERTY: "PROPERTY";
|
|
97
|
+
EXPANDED_PROPERTY_OPERATOR: "EXPANDED_PROPERTY_OPERATOR";
|
|
98
|
+
CUSTOM_PROPERTY_OPERATOR: "CUSTOM_PROPERTY_OPERATOR";
|
|
99
|
+
PROPERTY_SEP: "PROPERTY_SEP";
|
|
100
|
+
BRAKCETR: "BRAKCETR";
|
|
101
|
+
REGEX_FLAGS: "REGEX_FLAGS";
|
|
102
|
+
};
|
|
103
|
+
export type SuggestionType = EnumLike<typeof SUGGESTION_TYPE>;
|
|
102
104
|
/**
|
|
103
105
|
* A suggestion entry that describes a type of suggestion.
|
|
104
106
|
*/
|
|
105
107
|
export type Suggestion = {
|
|
106
|
-
type:
|
|
108
|
+
type: SuggestionType;
|
|
107
109
|
/** The range the suggestion should replace / be inserted at. */
|
|
108
110
|
range: Position;
|
|
109
111
|
/** {@link CursorInfo} */
|