Skip to content

Commit 6d1a2d5

Browse files
committed
style: fix lint error
1 parent 7e32484 commit 6d1a2d5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ function postHTMLParser(html, options) {
4848
function normalizeArributes(attrs) {
4949
var result = {};
5050
Object.keys(attrs).forEach(function(key) {
51-
Object.assign(result, {[key]: attrs[key].replace(/"/g, '"')});
51+
var obj = {};
52+
obj[key] = attrs[key].replace(/"/g, '"');
53+
Object.assign(result, obj);
5254
});
5355

5456
return result;
@@ -68,7 +70,7 @@ function postHTMLParser(html, options) {
6870
last.content || (last.content = []);
6971
last.content.push(comment);
7072
},
71-
onopentag: function(tag, attrs) {
73+
onopentag: function(tag) {
7274
var buf = { tag: tag };
7375

7476
if (Object.keys(bufAttributes).length) {
@@ -79,7 +81,9 @@ function postHTMLParser(html, options) {
7981
bufArray.push(buf);
8082
},
8183
onattribute: function(name, value) {
82-
Object.assign(bufAttributes, {[name]: value});
84+
var obj = {};
85+
obj[name] = value;
86+
Object.assign(bufAttributes, obj);
8387
},
8488
onclosetag: function() {
8589
var buf = bufArray.pop();

0 commit comments

Comments
 (0)