easy-template-x 3.0.2 → 3.0.3
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var xmldom = require('xmldom');
|
|
5
|
+
var xmldom = require('@xmldom/xmldom');
|
|
6
6
|
var getProp = require('lodash.get');
|
|
7
7
|
var JSZip = require('jszip');
|
|
8
8
|
|
|
@@ -26,7 +26,6 @@ function _interopNamespace(e) {
|
|
|
26
26
|
return Object.freeze(n);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var xmldom__namespace = /*#__PURE__*/_interopNamespace(xmldom);
|
|
30
29
|
var getProp__default = /*#__PURE__*/_interopDefaultLegacy(getProp);
|
|
31
30
|
var JSZip__namespace = /*#__PURE__*/_interopNamespace(JSZip);
|
|
32
31
|
|
|
@@ -1019,7 +1018,7 @@ class XmlParser {
|
|
|
1019
1018
|
|
|
1020
1019
|
_defineProperty(XmlParser, "xmlHeader", '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
|
|
1021
1020
|
|
|
1022
|
-
_defineProperty(XmlParser, "parser", new
|
|
1021
|
+
_defineProperty(XmlParser, "parser", new xmldom.DOMParser());
|
|
1023
1022
|
|
|
1024
1023
|
class MatchState {
|
|
1025
1024
|
constructor() {
|
|
@@ -3308,7 +3307,7 @@ class TemplateHandler {
|
|
|
3308
3307
|
constructor(options) {
|
|
3309
3308
|
var _this$options$extensi, _this$options$extensi2, _this$options$extensi3, _this$options$extensi4;
|
|
3310
3309
|
|
|
3311
|
-
_defineProperty(this, "version", "3.0.
|
|
3310
|
+
_defineProperty(this, "version", "3.0.3" );
|
|
3312
3311
|
|
|
3313
3312
|
_defineProperty(this, "xmlParser", new XmlParser());
|
|
3314
3313
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DOMParser } from '@xmldom/xmldom';
|
|
2
2
|
import getProp from 'lodash.get';
|
|
3
3
|
import * as JSZip from 'jszip';
|
|
4
4
|
|
|
@@ -991,7 +991,7 @@ class XmlParser {
|
|
|
991
991
|
|
|
992
992
|
_defineProperty(XmlParser, "xmlHeader", '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
|
|
993
993
|
|
|
994
|
-
_defineProperty(XmlParser, "parser", new
|
|
994
|
+
_defineProperty(XmlParser, "parser", new DOMParser());
|
|
995
995
|
|
|
996
996
|
class MatchState {
|
|
997
997
|
constructor() {
|
|
@@ -3280,7 +3280,7 @@ class TemplateHandler {
|
|
|
3280
3280
|
constructor(options) {
|
|
3281
3281
|
var _this$options$extensi, _this$options$extensi2, _this$options$extensi3, _this$options$extensi4;
|
|
3282
3282
|
|
|
3283
|
-
_defineProperty(this, "version", "3.0.
|
|
3283
|
+
_defineProperty(this, "version", "3.0.3" );
|
|
3284
3284
|
|
|
3285
3285
|
_defineProperty(this, "xmlParser", new XmlParser());
|
|
3286
3286
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-template-x",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Generate docx documents from templates, in Node or in the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docx",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"release": "yarn clean && yarn quality && yarn build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
42
|
+
"@xmldom/xmldom": "0.8.6",
|
|
43
|
+
"jszip": "3.10.1",
|
|
44
|
+
"lodash.get": "4.4.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@babel/core": "7.18.6",
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"@types/jszip": "3.4.1",
|
|
58
58
|
"@types/node": "18.0.1",
|
|
59
59
|
"@types/ts-nameof": "4.2.1",
|
|
60
|
-
"@types/xmldom": "0.1.31",
|
|
61
60
|
"@typescript-eslint/eslint-plugin": "5.30.4",
|
|
62
61
|
"@typescript-eslint/parser": "5.30.4",
|
|
63
62
|
"babel-jest": "28.1.2",
|
package/src/xml/xmlParser.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DOMParser } from '@xmldom/xmldom';
|
|
2
2
|
import { MissingArgumentError } from '../errors';
|
|
3
3
|
import { XmlNode } from './xmlNode';
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ export class XmlParser {
|
|
|
10
10
|
* handles xml namespaces more forgivingly (required mainly by the
|
|
11
11
|
* RawXmlPlugin).
|
|
12
12
|
*/
|
|
13
|
-
private static readonly parser = new
|
|
13
|
+
private static readonly parser = new DOMParser();
|
|
14
14
|
|
|
15
15
|
public parse(str: string): XmlNode {
|
|
16
16
|
const doc = this.domParse(str);
|
|
@@ -26,5 +26,5 @@ export class XmlParser {
|
|
|
26
26
|
|
|
27
27
|
public serialize(xmlNode: XmlNode): string {
|
|
28
28
|
return XmlParser.xmlHeader + XmlNode.serialize(xmlNode);
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
}
|