Skip to content

Commit

Permalink
Fix node attributes not string
Browse files Browse the repository at this point in the history
  • Loading branch information
thewebartisan7 committed Nov 3, 2022
1 parent 0749871 commit f2c68f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/process-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const union = require('lodash/union');
const each = require('lodash/each');
const has = require('lodash/has');
const extend = require('lodash/extend');
const isObject = require('lodash/isObject');

/**
* Map component attributes that it's not defined as props to first element of node
Expand Down Expand Up @@ -65,6 +66,8 @@ module.exports = (currentNode, attributes, props, options) => {
each(nodeAttrs, (value, key) => {
if (['undefined', 'null'].includes(value)) {
delete nodeAttrs[key];
} else if (!isObject(nodeAttrs[key])) {
nodeAttrs[key] = nodeAttrs[key].toString();
}
});

Expand Down

0 comments on commit f2c68f3

Please sign in to comment.