From 1081af4f673a04642697141108a876140d149901 Mon Sep 17 00:00:00 2001 From: Pavan Date: Thu, 1 Feb 2018 19:48:02 +0530 Subject: [PATCH] es5 --- index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index bdb09a0..c2537a1 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,6 @@ 'use strict' -module.exports = { - unescape, - escape, - encode, - decode -} + function unescape (str) { return (str + '==='.slice((str.length + 3) % 4)) @@ -26,3 +21,10 @@ function encode (str, encoding) { function decode (str, encoding) { return Buffer.from(unescape(str), 'base64').toString(encoding || 'utf8') } + +module.exports = { + unescape:unescape, + escape:escape, + encode:encode, + decode:decode +}