UNPKG

assetgraph

Version:

An auto discovery dependency graph based optimization framework for web pages and applications

19 lines (14 loc) 402 B
const HtmlRelation = require('./HtmlRelation'); class HtmlAnchor extends HtmlRelation { get href() { return this.node.getAttribute('href'); } set href(href) { this.node.setAttribute('href', href); } attach(position, adjacentRelation) { this.node = this.from.parseTree.createElement('a'); return super.attach(position, adjacentRelation); } } module.exports = HtmlAnchor;