Skip to content

Commit

Permalink
fix: fix the error when the attrs field is null
Browse files Browse the repository at this point in the history
fix the error by Object.keys(attrs) when the attrs field is null
  • Loading branch information
Ray93 committed Jul 31, 2024
1 parent 39879c3 commit 2e364db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ export function xmlElement(name, attrs, text) {
} else if (typeof attrs === 'string' || typeof attrs === 'number') {
node.appendChild(xmlTextNode(/** @type {number|string} */ (attrs).toString()));
return node;
} else if (!attrs) {
return node;
}

if (Array.isArray(attrs)) {
if (!attrs) {
return node;
} else if (Array.isArray(attrs)) {
for (const attr of attrs) {
if (Array.isArray(attr)) {
// eslint-disable-next-line no-eq-null
Expand Down

0 comments on commit 2e364db

Please sign in to comment.