@xmldom/xmldom 0.9.0 → 0.9.1

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/lib/dom.js CHANGED
@@ -980,7 +980,7 @@ DOMImplementation.prototype = {
980
980
  *
981
981
  * **This behavior is slightly different from the in the specs**:
982
982
  * - undeclared properties: nodeType, baseURI, isConnected, parentElement, textContent
983
- * - missing methods: nodeType, baseURI, isConnected, parentElement, textContent
983
+ * - missing methods: contains, getRootNode, isEqualNode, isSameNode
984
984
  *
985
985
  * @class
986
986
  * @abstract
@@ -1018,12 +1018,6 @@ Node.prototype = {
1018
1018
  * @type {Node | null}
1019
1019
  */
1020
1020
  nextSibling: null,
1021
- /**
1022
- * The attributes of this node.
1023
- *
1024
- * @type {NamedNodeMap | null}
1025
- */
1026
- attributes: null,
1027
1021
  /**
1028
1022
  * The parent node of this node.
1029
1023
  *
@@ -1213,16 +1207,6 @@ Node.prototype = {
1213
1207
  isSupported: function (feature, version) {
1214
1208
  return this.ownerDocument.implementation.hasFeature(feature, version);
1215
1209
  },
1216
- /**
1217
- * Determines if the node has any attributes.
1218
- *
1219
- * @returns {boolean}
1220
- * Returns true if the node has any attributes, and false otherwise.
1221
- * @since Introduced in DOM Level 2
1222
- */
1223
- hasAttributes: function () {
1224
- return this.attributes.length > 0;
1225
- },
1226
1210
  /**
1227
1211
  * Look up the prefix associated to the given namespace URI, starting from this node.
1228
1212
  * **The default namespace declarations are ignored by this method.**
@@ -1966,7 +1950,7 @@ Document.prototype = {
1966
1950
 
1967
1951
  insertBefore: function (newChild, refChild) {
1968
1952
  //raises
1969
- if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
1953
+ if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
1970
1954
  var child = newChild.firstChild;
1971
1955
  while (child) {
1972
1956
  var next = child.nextSibling;
@@ -2206,6 +2190,12 @@ function Element(symbol) {
2206
2190
  }
2207
2191
  Element.prototype = {
2208
2192
  nodeType: ELEMENT_NODE,
2193
+ /**
2194
+ * The attributes of this element.
2195
+ *
2196
+ * @type {NamedNodeMap | null}
2197
+ */
2198
+ attributes: null,
2209
2199
  getQualifiedName: function () {
2210
2200
  return this.prefix ? this.prefix + ':' + this.localName : this.localName;
2211
2201
  },
@@ -2453,7 +2443,7 @@ CDATASection.prototype = {
2453
2443
  nodeName: '#cdata-section',
2454
2444
  nodeType: CDATA_SECTION_NODE,
2455
2445
  };
2456
- _extends(CDATASection, CharacterData);
2446
+ _extends(CDATASection, Text);
2457
2447
 
2458
2448
  function DocumentType(symbol) {
2459
2449
  checkSymbol(symbol);
@@ -2930,5 +2920,5 @@ exports.Node = Node;
2930
2920
  exports.NodeList = NodeList;
2931
2921
  exports.Notation = Notation;
2932
2922
  exports.Text = Text;
2933
- exports.XMLSerializer = XMLSerializer;
2934
2923
  exports.ProcessingInstruction = ProcessingInstruction;
2924
+ exports.XMLSerializer = XMLSerializer;
package/lib/errors.js CHANGED
@@ -100,7 +100,7 @@ function endsWithError(value) {
100
100
  * passed when null was not expected.
101
101
  *
102
102
  * This implementation supports the following usages:
103
- * 1. according to the living standard (both arguments are mandatory):
103
+ * 1. according to the living standard (both arguments are optional):
104
104
  * ```
105
105
  * new DOMException("message (can be empty)", DOMExceptionNames.HierarchyRequestError)
106
106
  * ```
@@ -179,8 +179,7 @@ var ExceptionCode = {
179
179
  var entries = Object.entries(ExceptionCode);
180
180
  for (var i = 0; i < entries.length; i++) {
181
181
  var key = entries[i][0];
182
- var value = entries[i][1];
183
- DOMException[key] = value;
182
+ DOMException[key] = entries[i][1];
184
183
  }
185
184
 
186
185
  /**
@@ -189,18 +188,15 @@ for (var i = 0; i < entries.length; i++) {
189
188
  * @class
190
189
  * @param {string} message
191
190
  * @param {any} [locator]
192
- * @param {Error} [cause]
193
- * Optional, can provide details about the location in the source.
194
191
  */
195
- function ParseError(message, locator, cause) {
192
+ function ParseError(message, locator) {
196
193
  this.message = message;
197
194
  this.locator = locator;
198
- this.cause = cause;
199
195
  if (Error.captureStackTrace) Error.captureStackTrace(this, ParseError);
200
196
  }
201
197
  extendError(ParseError);
202
198
 
203
199
  exports.DOMException = DOMException;
204
200
  exports.DOMExceptionName = DOMExceptionName;
205
- exports.ParseError = ParseError;
206
201
  exports.ExceptionCode = ExceptionCode;
202
+ exports.ParseError = ParseError;
package/lib/index.js CHANGED
@@ -8,13 +8,12 @@ exports.MIME_TYPE = conventions.MIME_TYPE;
8
8
  exports.NAMESPACE = conventions.NAMESPACE;
9
9
 
10
10
  var errors = require('./errors');
11
- exports.ParseError = errors.ParseError;
12
11
  exports.DOMException = errors.DOMException;
12
+ exports.DOMExceptionName = errors.DOMExceptionName;
13
13
  exports.ExceptionCode = errors.ExceptionCode;
14
+ exports.ParseError = errors.ParseError;
14
15
 
15
16
  var dom = require('./dom');
16
- exports.DOMImplementation = dom.DOMImplementation;
17
- exports.XMLSerializer = dom.XMLSerializer;
18
17
  exports.Attr = dom.Attr;
19
18
  exports.CDATASection = dom.CDATASection;
20
19
  exports.CharacterData = dom.CharacterData;
@@ -22,15 +21,18 @@ exports.Comment = dom.Comment;
22
21
  exports.Document = dom.Document;
23
22
  exports.DocumentFragment = dom.DocumentFragment;
24
23
  exports.DocumentType = dom.DocumentType;
24
+ exports.DOMImplementation = dom.DOMImplementation;
25
25
  exports.Element = dom.Element;
26
- exports.EntityReference = dom.EntityReference;
27
26
  exports.Entity = dom.Entity;
27
+ exports.EntityReference = dom.EntityReference;
28
+ exports.LiveNodeList = dom.LiveNodeList;
28
29
  exports.NamedNodeMap = dom.NamedNodeMap;
29
30
  exports.Node = dom.Node;
30
31
  exports.NodeList = dom.NodeList;
31
32
  exports.Notation = dom.Notation;
32
33
  exports.ProcessingInstruction = dom.ProcessingInstruction;
33
34
  exports.Text = dom.Text;
35
+ exports.XMLSerializer = dom.XMLSerializer;
34
36
 
35
37
  var domParser = require('./dom-parser');
36
38
  exports.DOMParser = domParser.DOMParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmldom/xmldom",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.",
5
5
  "keywords": [
6
6
  "w3c",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "lint": "eslint examples lib test",
32
- "format": "prettier --write examples lib test",
32
+ "format": "prettier --write examples lib test index.d.ts",
33
33
  "changelog": "auto-changelog --unreleased-only",
34
34
  "start": "nodemon --watch package.json --watch lib --watch test --exec 'npm --silent run test && npm --silent run lint'",
35
35
  "test": "jest",
@@ -40,7 +40,7 @@
40
40
  "release": "np --no-yarn --test-script testrelease"
41
41
  },
42
42
  "engines": {
43
- "node": ">=10.0.0"
43
+ "node": ">=14.0.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@homer0/prettier-plugin-jsdoc": "9.0.2",
@@ -59,8 +59,8 @@
59
59
  "np": "8.0.4",
60
60
  "prettier": "3.3.3",
61
61
  "rxjs": "7.8.1",
62
- "xmltest": "1.5.0",
63
- "yauzl": "2.10.0"
62
+ "xmltest": "2.0.1",
63
+ "yauzl": "3.1.3"
64
64
  },
65
65
  "bugs": {
66
66
  "url": "https://github.com/xmldom/xmldom/issues"