Skip to content

Commit

Permalink
Update from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ethomson committed Dec 12, 2023
1 parent 62bc5c6 commit 1939dd7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8553,14 +8553,14 @@ function wrappy (fn, cb) {
this.saxParser.onopentag = (function(_this) {
return function(node) {
var key, newValue, obj, processedKey, ref;
obj = {};
obj = Object.create(null);
obj[charkey] = "";
if (!_this.options.ignoreAttrs) {
ref = node.attributes;
for (key in ref) {
if (!hasProp.call(ref, key)) continue;
if (!(attrkey in obj) && !_this.options.mergeAttrs) {
obj[attrkey] = {};
obj[attrkey] = Object.create(null);
}
newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
Expand Down Expand Up @@ -8610,7 +8610,11 @@ function wrappy (fn, cb) {
}
}
if (isEmpty(obj)) {
obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
if (typeof _this.options.emptyTag === 'function') {
obj = _this.options.emptyTag();
} else {
obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
}
}
if (_this.options.validator != null) {
xpath = "/" + ((function() {
Expand All @@ -8634,7 +8638,7 @@ function wrappy (fn, cb) {
}
if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
if (!_this.options.preserveChildrenOrder) {
node = {};
node = Object.create(null);
if (_this.options.attrkey in obj) {
node[_this.options.attrkey] = obj[_this.options.attrkey];
delete obj[_this.options.attrkey];
Expand All @@ -8649,7 +8653,7 @@ function wrappy (fn, cb) {
obj = node;
} else if (s) {
s[_this.options.childkey] = s[_this.options.childkey] || [];
objClone = {};
objClone = Object.create(null);
for (key in obj) {
if (!hasProp.call(obj, key)) continue;
objClone[key] = obj[key];
Expand All @@ -8666,7 +8670,7 @@ function wrappy (fn, cb) {
} else {
if (_this.options.explicitRoot) {
old = obj;
obj = {};
obj = Object.create(null);
obj[nodeName] = old;
}
_this.resultObject = obj;
Expand Down

0 comments on commit 1939dd7

Please sign in to comment.