Comparing version 2.1.0 to 2.1.1
{ | ||
"name": "slug", | ||
"description": "slugifies even utf-8 chars!", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"homepage": "https://github.com/Trott/node-slug", | ||
@@ -22,3 +22,3 @@ "author": "dodo (https://github.com/dodo)", | ||
"scripts": { | ||
"test": "eslint . && mocha ./test/*.test.* --require should --reporter spec --colors" | ||
"test": "eslint . && c8 mocha ./test/*.test.* --require should --reporter spec --colors" | ||
}, | ||
@@ -29,4 +29,5 @@ "dependencies": { | ||
"devDependencies": { | ||
"c8": "^7.0.0", | ||
"eslint": "^6.8.0", | ||
"mocha": "^6.2.1", | ||
"mocha": "^7.0.0", | ||
"should": "~13.2.3" | ||
@@ -33,0 +34,0 @@ }, |
10
slug.js
@@ -14,6 +14,10 @@ (function (root) { | ||
if (typeof window === 'undefined') { | ||
base64 = (input) => Buffer.from(input).toString('base64'); | ||
base64 = function(input) { | ||
return Buffer.from(input).toString('base64'); | ||
} | ||
} else { | ||
// eslint-disable-next-line no-undef | ||
base64 = (input) => btoa(unescape(encodeURIComponent(input))) | ||
base64 = function(input) { | ||
// eslint-disable-next-line no-undef | ||
return btoa(unescape(encodeURIComponent(input))) | ||
} | ||
} | ||
@@ -20,0 +24,0 @@ |
Sorry, the diff of this file is not supported yet
15245
4
6
228