@e-mc/document 0.11.15 → 0.11.17

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.11.15/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.11.17/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, ViewEngine } from "./squared";
@@ -185,14 +185,14 @@ NOTE: **@e-mc/document** is an abstract base class and cannot be instantiated. *
185
185
 
186
186
  ## References
187
187
 
188
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/squared.d.ts
189
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/asset.d.ts
190
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/core.d.ts
191
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/document.d.ts
192
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/filemanager.d.ts
193
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/logger.d.ts
194
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/settings.d.ts
195
- - https://www.unpkg.com/@e-mc/types@0.11.15/lib/watch.d.ts
188
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/squared.d.ts
189
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/asset.d.ts
190
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/core.d.ts
191
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/document.d.ts
192
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/filemanager.d.ts
193
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/logger.d.ts
194
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/settings.d.ts
195
+ - https://www.unpkg.com/@e-mc/types@0.11.17/lib/watch.d.ts
196
196
 
197
197
  ## LICENSE
198
198
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/document",
3
- "version": "0.11.15",
3
+ "version": "0.11.17",
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.11.15",
24
- "@e-mc/db": "0.11.15",
25
- "@e-mc/types": "0.11.15",
23
+ "@e-mc/core": "0.11.17",
24
+ "@e-mc/db": "0.11.17",
25
+ "@e-mc/types": "0.11.17",
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
@@ -172,12 +172,13 @@ class XmlWriter {
172
172
  });
173
173
  }
174
174
  static escapeAttributes(source) {
175
- let escaped, match, attribute;
175
+ let match, attribute;
176
176
  while (match = REGEXP_TAGATTR.exec(source)) {
177
177
  let output = match[0], modified = false;
178
- while (attribute = REGEXP_ATTRVALUE.exec(match[1])) {
178
+ while (attribute = REGEXP_ATTRVALUE.exec(output)) {
179
179
  const value = attribute[2] || attribute[3] || attribute[4];
180
- if (value && (escaped = this.escapeXmlString(value)) !== value) {
180
+ const escaped = this.escapeXmlString(value);
181
+ if (value !== escaped) {
181
182
  output = (0, util_1.spliceMatch)(output, attribute, attribute[1] + `="${escaped}"`, REGEXP_ATTRVALUE);
182
183
  modified = true;
183
184
  }
@@ -393,7 +394,6 @@ class XmlWriter {
393
394
  const result = [];
394
395
  const flags = ignoreCase ? 'gi' : 'g';
395
396
  let pattern = CACHE_TAGNAME[tagPattern + flags] ||= new RegExp(`<(?:(!--[\\S\\s]*?--)|(!\\[CDATA\\[[\\S\\s]*?\\]\\])` + (tagPattern ? '|' + `(${tagPattern})${this.PATTERN_TAGOPEN}*` : '') + ')>', flags), match;
396
- pattern.lastIndex = 0;
397
397
  while (match = pattern.exec(source)) {
398
398
  if (stripXml) {
399
399
  source = this.replaceMatch(match, source, '', { pattern, trimLeading: true });
@@ -409,6 +409,7 @@ class XmlWriter {
409
409
  result.push({ type, outerXml: source.substring(startIndex, endIndex + 1), startIndex, endIndex });
410
410
  }
411
411
  }
412
+ pattern.lastIndex = 0;
412
413
  if (stripXml) {
413
414
  return source;
414
415
  }
@@ -1124,7 +1125,6 @@ class XmlElement {
1124
1125
  }
1125
1126
  this._tagVoid = isVoid;
1126
1127
  REGEXP_ATTRVALUE.lastIndex = 0;
1127
- REGEXP_ATTRNAME.lastIndex = 0;
1128
1128
  }
1129
1129
  else if (tagVoid) {
1130
1130
  this._tagVoid = true;