Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ent

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ent - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

7

index.js

@@ -0,1 +1,2 @@

var punycode = require('punycode');
var entities = require('./entities.json');

@@ -40,6 +41,6 @@

.replace(/&#(\d+);?/g, function (_, code) {
return String.fromCharCode(code);
return punycode.ucs2.encode([code]);
})
.replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) {
return String.fromCharCode(parseInt(hex, 16));
return punycode.ucs2.encode([parseInt(hex, 16)]);
})

@@ -53,3 +54,3 @@ .replace(/&([^;\W]+;?)/g, function (m, e) {

if (typeof target === 'number') {
return String.fromCharCode(target);
return punycode.ucs2.encode([target]);
}

@@ -56,0 +57,0 @@ else if (typeof target === 'string') {

{
"name" : "ent",
"description" : "Encode and decode HTML entities",
"version" : "0.0.6",
"version" : "0.0.7",
"repository" : "https://github.com/substack/node-ent.git",

@@ -31,5 +31,5 @@ "author" : "James Halliday <mail@substack.net> (http://substack.net)",

"devDependencies" : {
"tap" : "~0.3.3",
"tape" : "~0.1.0"
"tap" : "~0.4.3",
"tape" : "~1.0.4"
}
}
var test = require('tape');
var punycode = require('punycode');
var ent = require('../');

@@ -61,1 +62,9 @@

});
test('astral num', function (t) {
var a = punycode.ucs2.encode([0x1d306]);
var b = '&#x1d306;';
t.equal(ent.decode(b), a);
t.equal(ent.decode(b + b), a + a);
t.end();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc