Comparing version 2.1.1 to 2.2.0
@@ -10,7 +10,2 @@ var punycode = require('punycode'); | ||
} | ||
var special = { | ||
'"': true, "'": true, | ||
'<': true, '>': true, | ||
'&': true | ||
}; | ||
if (!opts) opts = {}; | ||
@@ -22,2 +17,8 @@ | ||
var special = opts.special || { | ||
'"': true, "'": true, | ||
'<': true, '>': true, | ||
'&': true | ||
}; | ||
var codePoints = punycode.ucs2.decode(str); | ||
@@ -24,0 +25,0 @@ var chars = []; |
{ | ||
"name" : "ent", | ||
"description" : "Encode and decode HTML entities", | ||
"version" : "2.1.1", | ||
"version" : "2.2.0", | ||
"repository" : "https://github.com/substack/node-ent.git", | ||
@@ -6,0 +6,0 @@ "author" : "James Halliday <mail@substack.net> (http://substack.net)", |
@@ -87,1 +87,16 @@ var test = require('tape'); | ||
}); | ||
test('encode `special` option', function (t) { | ||
var a = '<>\'"&'; | ||
var b = '<>\'"&'; | ||
t.equal(ent.encode(a, { | ||
named: true, | ||
special: { | ||
'<': true, | ||
'>': true, | ||
'&': true | ||
} | ||
}), b); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
97816
3741
72
0