Socket
Socket
Sign inDemoInstall

ent

Package Overview
Dependencies
Maintainers
0
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.3 to 0.0.4

4

index.js

@@ -42,6 +42,6 @@ var fs = require('fs');

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

@@ -48,0 +48,0 @@ })

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

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

@@ -23,2 +23,5 @@ var assert = require('assert');

assert.eql(ent.decode(b), a);
assert.eql(ent.encode(a + a), b + b);
assert.eql(ent.decode(b + b), a + a);
};

@@ -48,6 +51,8 @@

var encoded = ent.encode(a);
var encoded2 = ent.encode(a + a);
if (!encoded.match(/^&\w+;/)) {
assert.equal(encoded, '&#' + i + ';');
assert.equal(encoded2, '&#' + i + ';&#' + i + ';');
}
}
};
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