Skip to content

Commit f2c68f3

Browse files
Fix node attributes not string
1 parent 0749871 commit f2c68f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/process-attributes.js

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const union = require('lodash/union');
99
const each = require('lodash/each');
1010
const has = require('lodash/has');
1111
const extend = require('lodash/extend');
12+
const isObject = require('lodash/isObject');
1213

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

0 commit comments

Comments
 (0)