Skip to content

Commit

Permalink
es5
Browse files Browse the repository at this point in the history
  • Loading branch information
tvpavan authored Feb 1, 2018
1 parent 140aa66 commit 1081af4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
'use strict'

module.exports = {
unescape,
escape,
encode,
decode
}


function unescape (str) {
return (str + '==='.slice((str.length + 3) % 4))
Expand All @@ -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
}

0 comments on commit 1081af4

Please sign in to comment.