@e-mc/document 0.10.18 → 0.10.20

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 CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.10.18/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.20/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, ViewEngine } from "./squared";
@@ -183,14 +183,14 @@ NOTE: **@e-mc/document** is an abstract base class and cannot be instantiated. *
183
183
 
184
184
  ## References
185
185
 
186
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/squared.d.ts
187
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/asset.d.ts
188
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/core.d.ts
189
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/document.d.ts
190
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/filemanager.d.ts
191
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/logger.d.ts
192
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/settings.d.ts
193
- - https://www.unpkg.com/@e-mc/types@0.10.18/lib/watch.d.ts
186
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/squared.d.ts
187
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/asset.d.ts
188
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/core.d.ts
189
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/document.d.ts
190
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/filemanager.d.ts
191
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/logger.d.ts
192
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/settings.d.ts
193
+ - https://www.unpkg.com/@e-mc/types@0.10.20/lib/watch.d.ts
194
194
 
195
195
  ## LICENSE
196
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/document",
3
- "version": "0.10.18",
3
+ "version": "0.10.20",
4
4
  "description": "Document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,14 +20,14 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.10.18",
24
- "@e-mc/db": "0.10.18",
25
- "@e-mc/types": "0.10.18",
23
+ "@e-mc/core": "0.10.20",
24
+ "@e-mc/db": "0.10.20",
25
+ "@e-mc/types": "0.10.20",
26
26
  "chalk": "4.1.2",
27
27
  "domhandler": "^5.0.3",
28
28
  "domutils": "^3.2.2",
29
29
  "htmlparser2": "^9.1.0",
30
30
  "js-yaml": "^4.1.1",
31
- "picomatch": "^4.0.3"
31
+ "picomatch": "^4.0.4"
32
32
  }
33
33
  }
package/parse/index.js CHANGED
@@ -166,12 +166,13 @@ class XmlWriter {
166
166
  });
167
167
  }
168
168
  static escapeAttributes(source) {
169
- let escaped, match, attribute;
169
+ let match, attribute;
170
170
  while (match = REGEXP_TAGATTR.exec(source)) {
171
- let output = match[0], modified;
172
- while (attribute = REGEXP_ATTRVALUE.exec(match[1])) {
171
+ let output = match[0], modified = false;
172
+ while (attribute = REGEXP_ATTRVALUE.exec(output)) {
173
173
  const value = attribute[2] || attribute[3] || attribute[4];
174
- if (value && (escaped = this.escapeXmlString(value)) !== value) {
174
+ const escaped = this.escapeXmlString(value);
175
+ if (value !== escaped) {
175
176
  output = (0, util_1.spliceMatch)(output, attribute, attribute[1] + `="${escaped}"`, REGEXP_ATTRVALUE);
176
177
  modified = true;
177
178
  }
@@ -387,7 +388,6 @@ class XmlWriter {
387
388
  const result = [];
388
389
  const flags = ignoreCase ? 'gi' : 'g';
389
390
  let pattern = CACHE_TAGNAME[tagPattern + flags] ||= new RegExp(`<(?:(!--[\\S\\s]*?--)|(!\\[CDATA\\[[\\S\\s]*?\\]\\])` + (tagPattern ? '|' + `(${tagPattern})${this.PATTERN_TAGOPEN}*` : '') + ')>', flags), match;
390
- pattern.lastIndex = 0;
391
391
  while (match = pattern.exec(source)) {
392
392
  if (stripXml) {
393
393
  source = this.replaceMatch(match, source, '', { pattern, trimLeading: true });
@@ -403,6 +403,7 @@ class XmlWriter {
403
403
  result.push({ type, outerXml: source.substring(startIndex, endIndex + 1), startIndex, endIndex });
404
404
  }
405
405
  }
406
+ pattern.lastIndex = 0;
406
407
  if (stripXml) {
407
408
  return source;
408
409
  }
@@ -1114,7 +1115,6 @@ class XmlElement {
1114
1115
  }
1115
1116
  this._tagVoid = isVoid;
1116
1117
  REGEXP_ATTRVALUE.lastIndex = 0;
1117
- REGEXP_ATTRNAME.lastIndex = 0;
1118
1118
  }
1119
1119
  else if (tagVoid) {
1120
1120
  this._tagVoid = true;