Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,5 @@ | ||
# 1.1.2 - 2016-10-27 | ||
- Remove `slug` dependency and replace it with `encodeURIComponent`. `slug` was including whole Unicode into final build. | ||
# 1.1.1 - 2016-04-20 | ||
@@ -2,0 +6,0 @@ |
@@ -1,2 +0,3 @@ | ||
// A module to forge IDs for Refract elements. | ||
// A safe way to slugify values. If the input is null, undefined, or | ||
// some other error happens downstream, we simply return `unknown`. | ||
'use strict'; | ||
@@ -8,22 +9,9 @@ | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
function safeSlug() { | ||
var value = arguments.length <= 0 || arguments[0] === undefined ? 'unknown' : arguments[0]; | ||
var _slug = require('slug'); | ||
var _slug2 = _interopRequireDefault(_slug); | ||
_slug2['default'].defaults.mode = 'rfc3986'; | ||
// A safe way to slugify values. If the input is null, undefined, or | ||
// some other error happens downstream, we simply return `unknown`. | ||
function safeSlug(value) { | ||
var sluggified = undefined; | ||
try { | ||
sluggified = (0, _slug2['default'])(value); | ||
} catch (err) { | ||
sluggified = 'unknown'; | ||
} | ||
return sluggified; | ||
return encodeURIComponent(value).toLowerCase().replace(/[!'()*]/g, function (x) { | ||
return '%' + x.charCodeAt(0).toString(16); | ||
}) // RFC 3986 & https://developer.mozilla.org/cs/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent | ||
.replace(/%20|%2520/g, '-'); // Swap (encoded) spaces for hyphens | ||
} | ||
@@ -30,0 +18,0 @@ |
{ | ||
"name": "abagnale", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Forge unique IDs for Refract data structure elements", | ||
@@ -27,5 +27,4 @@ "main": "lib/abagnale.js", | ||
"dependencies": { | ||
"babel-runtime": "^5.0.0", | ||
"slug": "^0.9.1" | ||
"babel-runtime": "^5.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25106
1
10
181
1
- Removedslug@^0.9.1
- Removedslug@0.9.4(transitive)
- Removedunicode@14.0.0(transitive)