htmljs-parser 3.2.3 → 3.3.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/index.js CHANGED
@@ -1069,10 +1069,7 @@ var EXPRESSION = {
1069
1069
  },
1070
1070
  eol(_, expression) {
1071
1071
  if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
1072
- if (checkForOperators(this, expression))
1073
- this.forward = 1;
1074
- else
1075
- this.exitState();
1072
+ this.exitState();
1076
1073
  }
1077
1074
  },
1078
1075
  eof(expression) {
@@ -1100,9 +1097,9 @@ var EXPRESSION = {
1100
1097
  }
1101
1098
  };
1102
1099
  function buildOperatorPattern(isConcise) {
1103
- const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!^\\s*|-)-${isConcise ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!${isConcise ? "^\\s*|" : ""}\\.)\\.(?!\\.)|<${isConcise ? "{2,}|(?<!^\\s*)<" : "+"}|>${isConcise ? "+" : "{2,}"}|\\bin(?:stanceof)?(?=\\s+[^=/,;:>])`;
1104
- const unary = "\\b(?:a(?:sync|wait)|class|function|new|typeof|void)\\b";
1105
- const lookAheadPattern = "\\s*(?:" + binary + `)\\s*|\\s+(?=[${isConcise ? "" : "["}{(])`;
1100
+ const binary = `(?:[!~*%&^|?:<]+=*)+|[>/+-=]+=|=>|(?<!\\+)[ \\t]*\\+(?:[ \\t]*\\+[ \\t]*\\+)*[ \\t]*(?!\\+)|(?<!-)-${isConcise ? "" : "(?:[ \\t]*-[ \\t]*-)*[ \\t]*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!\\.)\\.(?!\\.)|>${isConcise ? "+" : "{2,}"}|\\b(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
1101
+ const unary = "\\b(?:a(?:sync|wait)|keyof|class|function|new|typeof|void)\\b";
1102
+ const lookAheadPattern = "[ \\t]*(?:" + binary + `)[ \\t]*|[ \\t]+(?=[{(])`;
1106
1103
  const lookBehindPattern = `(?<=${unary}|${binary})`;
1107
1104
  return new RegExp(`${lookAheadPattern}|${lookBehindPattern}`, "ym");
1108
1105
  }
package/dist/index.mjs CHANGED
@@ -1048,10 +1048,7 @@ var EXPRESSION = {
1048
1048
  },
1049
1049
  eol(_, expression) {
1050
1050
  if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
1051
- if (checkForOperators(this, expression))
1052
- this.forward = 1;
1053
- else
1054
- this.exitState();
1051
+ this.exitState();
1055
1052
  }
1056
1053
  },
1057
1054
  eof(expression) {
@@ -1079,9 +1076,9 @@ var EXPRESSION = {
1079
1076
  }
1080
1077
  };
1081
1078
  function buildOperatorPattern(isConcise) {
1082
- const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!^\\s*|-)-${isConcise ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!${isConcise ? "^\\s*|" : ""}\\.)\\.(?!\\.)|<${isConcise ? "{2,}|(?<!^\\s*)<" : "+"}|>${isConcise ? "+" : "{2,}"}|\\bin(?:stanceof)?(?=\\s+[^=/,;:>])`;
1083
- const unary = "\\b(?:a(?:sync|wait)|class|function|new|typeof|void)\\b";
1084
- const lookAheadPattern = "\\s*(?:" + binary + `)\\s*|\\s+(?=[${isConcise ? "" : "["}{(])`;
1079
+ const binary = `(?:[!~*%&^|?:<]+=*)+|[>/+-=]+=|=>|(?<!\\+)[ \\t]*\\+(?:[ \\t]*\\+[ \\t]*\\+)*[ \\t]*(?!\\+)|(?<!-)-${isConcise ? "" : "(?:[ \\t]*-[ \\t]*-)*[ \\t]*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!\\.)\\.(?!\\.)|>${isConcise ? "+" : "{2,}"}|\\b(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
1080
+ const unary = "\\b(?:a(?:sync|wait)|keyof|class|function|new|typeof|void)\\b";
1081
+ const lookAheadPattern = "[ \\t]*(?:" + binary + `)[ \\t]*|[ \\t]+(?=[{(])`;
1085
1082
  const lookBehindPattern = `(?<=${unary}|${binary})`;
1086
1083
  return new RegExp(`${lookAheadPattern}|${lookBehindPattern}`, "ym");
1087
1084
  }
package/package.json CHANGED
@@ -1,34 +1,32 @@
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": "3.2.3",
5
- "author": "Phillip Gates-Idem <phillip.idem@gmail.com>",
4
+ "version": "3.3.2",
6
5
  "devDependencies": {
7
- "@commitlint/cli": "^16.2.3",
8
- "@commitlint/config-conventional": "^16.2.1",
6
+ "@changesets/changelog-github": "^0.4.4",
7
+ "@changesets/cli": "^2.22.0",
9
8
  "@types/benchmark": "^2.1.1",
10
9
  "@types/degit": "^2.8.3",
11
- "@types/mocha": "^9.1.0",
12
- "@types/node": "^17.0.22",
13
- "@typescript-eslint/eslint-plugin": "^5.16.0",
14
- "@typescript-eslint/parser": "^5.16.0",
10
+ "@types/mocha": "^9.1.1",
11
+ "@types/node": "^17.0.27",
12
+ "@typescript-eslint/eslint-plugin": "^5.21.0",
13
+ "@typescript-eslint/parser": "^5.21.0",
15
14
  "benchmark": "^2.1.4",
16
15
  "cross-env": "^7.0.3",
17
16
  "degit": "^2.8.4",
18
- "esbuild": "0.14.27",
17
+ "esbuild": "0.14.38",
19
18
  "esbuild-register": "^3.3.2",
20
- "eslint": "^8.11.0",
19
+ "eslint": "^8.14.0",
21
20
  "eslint-config-prettier": "^8.5.0",
22
21
  "fast-glob": "^3.2.11",
23
22
  "fixpack": "^4.0.0",
24
23
  "husky": "^7.0.4",
25
- "lint-staged": "^12.3.7",
24
+ "lint-staged": "^12.4.1",
26
25
  "mocha": "^9.2.2",
27
26
  "mocha-snap": "^4.3.0",
28
27
  "nyc": "^15.1.0",
29
- "prettier": "^2.6.0",
30
- "semantic-release": "^19.0.2",
31
- "typescript": "^4.6.2"
28
+ "prettier": "^2.6.2",
29
+ "typescript": "^4.6.3"
32
30
  },
33
31
  "exports": {
34
32
  ".": {
@@ -71,11 +69,12 @@
71
69
  "mocha": "cross-env NODE_ENV=test mocha \"./src/**/__tests__/*.test.ts\"",
72
70
  "prepare": "husky install",
73
71
  "prepublishOnly": "npm run build",
74
- "release": "semantic-release",
72
+ "publish": "npm run build && changeset publish",
75
73
  "report": "open ./coverage/lcov-report/index.html",
76
74
  "test": "npm run mocha -- --watch",
77
75
  "test:inspect": "npm test -- --inspect",
78
- "test:update": "npm run mocha -- --update"
76
+ "test:update": "npm run mocha -- --update",
77
+ "version": "changeset version"
79
78
  },
80
79
  "types": "dist/index.d.ts"
81
80
  }