Skip to content

Commit

Permalink
Back to fat arrows (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Feb 20, 2018
1 parent e9989ca commit ab24bd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -13,13 +13,13 @@ function urlDecode (encoded) {
return encoded
}

module.exports.pack = function (json) {
module.exports.pack = json => {
const str = pako.deflate(JSON.stringify(json), {to: 'string'})
const buf = Buffer.from(str)
return urlEncode(buf.toString('base64'))
}

module.exports.unpack = function (b64) {
module.exports.unpack = b64 => {
const buf = Buffer.from(urlDecode(b64).toString('base64'), 'base64')
const json = JSON.parse(pako.inflate(buf.toString(), { to: 'string' }))
return json
Expand Down

0 comments on commit ab24bd6

Please sign in to comment.