diff --git a/lib/node.js b/lib/node.js index c41b810..c5d8567 100644 --- a/lib/node.js +++ b/lib/node.js @@ -1,7 +1,5 @@ 'use strict' -const Attribute = require('./attribute') - const htmlParser = require('htmlparser2') const domUtils = htmlParser.DomUtils const fs = require('fs') @@ -151,24 +149,7 @@ class Node { } /** - * Returns or sets the attribute for the given key and value - * @param {string|Attribute} attr a key for getting an attribute or an attribute for setting the attribute on this node - * @returns {Attribute} - */ - attribute(attr) { - const attributes = this.get().attribs - - if (typeof attr === 'string') { - return new Attribute(attr, attributes[attr]) - } else if (typeof attr === 'object') { - attributes[attr.key] = attr.value - } - - return new Attribute(attr.key, attr.value) - } - - /** - * Returns all attributes of this node + * Returns all attributes of this node. The returned object is live, so you can add or remove attributes as you wish * @returns {Object} */ get attributes() {