htmljs-parser 5.0.4 → 5.1.2
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/core/Parser.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1067 -644
- package/dist/index.mjs +1062 -643
- package/dist/states/EXPRESSION.d.ts +2 -2
- package/dist/states/OPEN_TAG.d.ts +1 -1
- package/dist/util/constants.d.ts +6 -1
- package/dist/util/util.d.ts +16 -3
- package/package.json +13 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StateDefinition, Meta } from "../internal";
|
|
2
2
|
export interface ExpressionMeta extends Meta {
|
|
3
3
|
groupStack: number[];
|
|
4
|
-
|
|
5
|
-
skipOperators: boolean;
|
|
4
|
+
operators: boolean;
|
|
6
5
|
terminatedByEOL: boolean;
|
|
7
6
|
terminatedByWhitespace: boolean;
|
|
7
|
+
shouldTerminate(code: number, data: string, pos: number): boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const EXPRESSION: StateDefinition<ExpressionMeta>;
|
package/dist/util/constants.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare const enum CODE {
|
|
|
27
27
|
DOLLAR = 36,
|
|
28
28
|
PERCENT = 37,
|
|
29
29
|
PERIOD = 46,
|
|
30
|
+
PLUS = 43,
|
|
30
31
|
COMMA = 44,
|
|
31
32
|
COLON = 58,
|
|
32
33
|
SEMICOLON = 59,
|
|
@@ -35,7 +36,11 @@ export declare const enum CODE {
|
|
|
35
36
|
NEWLINE = 10,
|
|
36
37
|
CARRIAGE_RETURN = 13,
|
|
37
38
|
SPACE = 32,
|
|
38
|
-
TAB = 9
|
|
39
|
+
TAB = 9,
|
|
40
|
+
AMPERSAND = 38,
|
|
41
|
+
CARET = 94,
|
|
42
|
+
TILDE = 126,
|
|
43
|
+
UNDERSCORE = 95
|
|
39
44
|
}
|
|
40
45
|
export interface Position {
|
|
41
46
|
/**
|
package/dist/util/util.d.ts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { type Parser } from "../internal";
|
|
2
|
-
import { Location, Position
|
|
2
|
+
import { Location, Position } from "./constants";
|
|
3
3
|
export declare function isWhitespaceCode(code: number): boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Given a source code line offsets, a start offset and an end offset, returns a Location object with line & character information for the start and end offsets.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getLocation(lines: number[], startOffset: number, endOffset: number): Location;
|
|
8
|
+
/**
|
|
9
|
+
* Given a source code line offsets and an offset, returns a Position object with line & character information.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getPosition(lines: number[], offset: number): Position;
|
|
12
|
+
/**
|
|
13
|
+
* Scan through some source code and generate an array of offsets for each newline.
|
|
14
|
+
* Useful for generating line/column information for source code.
|
|
15
|
+
*/
|
|
6
16
|
export declare function getLines(src: string): number[];
|
|
7
17
|
export declare function htmlEOF(this: Parser): void;
|
|
18
|
+
export declare function matchesCloseParen(code: number): boolean;
|
|
19
|
+
export declare function matchesCloseCurlyBrace(code: number): boolean;
|
|
20
|
+
export declare function matchesPipe(code: number): boolean;
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "htmljs-parser",
|
|
3
3
|
"description": "An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.1.2",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@changesets/changelog-github": "^0.4.
|
|
7
|
-
"@changesets/cli": "^2.
|
|
6
|
+
"@changesets/changelog-github": "^0.4.6",
|
|
7
|
+
"@changesets/cli": "^2.24.1",
|
|
8
8
|
"@types/degit": "^2.8.3",
|
|
9
9
|
"@types/mocha": "^9.1.1",
|
|
10
|
-
"@types/node": "^
|
|
11
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
12
|
-
"@typescript-eslint/parser": "^5.
|
|
10
|
+
"@types/node": "^18.6.4",
|
|
11
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
12
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
13
13
|
"cross-env": "^7.0.3",
|
|
14
14
|
"degit": "^2.8.4",
|
|
15
|
-
"esbuild": "0.14.
|
|
16
|
-
"eslint": "^8.
|
|
15
|
+
"esbuild": "0.14.53",
|
|
16
|
+
"eslint": "^8.21.0",
|
|
17
17
|
"eslint-config-prettier": "^8.5.0",
|
|
18
18
|
"fast-glob": "^3.2.11",
|
|
19
19
|
"fixpack": "^4.0.0",
|
|
20
20
|
"husky": "^8.0.1",
|
|
21
|
-
"lint-staged": "^13.0.
|
|
22
|
-
"mitata": "^0.1.
|
|
21
|
+
"lint-staged": "^13.0.3",
|
|
22
|
+
"mitata": "^0.1.6",
|
|
23
23
|
"mocha": "^10.0.0",
|
|
24
24
|
"mocha-snap": "^4.3.0",
|
|
25
25
|
"nyc": "^15.1.0",
|
|
26
|
-
"prettier": "^2.
|
|
27
|
-
"tsx": "^3.
|
|
28
|
-
"typescript": "^4.7.
|
|
26
|
+
"prettier": "^2.7.1",
|
|
27
|
+
"tsx": "^3.8.0",
|
|
28
|
+
"typescript": "^4.7.4"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|