diff --git a/examples/node/domstubs.js b/examples/node/domstubs.js index fcd54c8ea..2efa7c0ac 100644 --- a/examples/node/domstubs.js +++ b/examples/node/domstubs.js @@ -197,6 +197,10 @@ DOMElementSerializer.prototype = { }, }; +function btoa (chars) { + return Buffer.from(chars, 'binary').toString('base64'); +} + const document = { childNodes : [], @@ -241,6 +245,7 @@ Image.prototype = { } } +exports.btoa = btoa; exports.document = document; exports.Image = Image;