From 783a18b7d1a6f60f6a93fb63b1639cbbf6b6d1ec Mon Sep 17 00:00:00 2001 From: stfsy Date: Sat, 6 Aug 2016 18:02:24 +0200 Subject: [PATCH] feat(node.js): allow stringifying of node instances --- lib/document.js | 9 --------- lib/node.js | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/document.js b/lib/document.js index 86536ca..b545545 100644 --- a/lib/document.js +++ b/lib/document.js @@ -67,15 +67,6 @@ class Document extends Node { return new Node(body[0]) } - - /** - * Returns the stringified version of this document - * @returns {string} - */ - toHtml() { - - return domUtils.getOuterHTML(this._element) - } } module.exports = Document \ No newline at end of file diff --git a/lib/node.js b/lib/node.js index fa7491d..506b647 100644 --- a/lib/node.js +++ b/lib/node.js @@ -223,6 +223,15 @@ class Node { return this } + + /** + * Returns the stringified version of this document + * @returns {string} + */ + toHtml() { + + return domUtils.getOuterHTML(this._element) + } } module.exports = Node \ No newline at end of file