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

escape-html-template-tag

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

escape-html-template-tag - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

index.mjs

21

index.js

@@ -0,1 +1,3 @@

'use strict';
const ENTITIES = {

@@ -10,9 +12,9 @@ '&': '&',

'=': '='
}
};
const ENT_REGEX = new RegExp(Object.keys(ENTITIES).join('|'), 'g')
const ENT_REGEX = new RegExp(Object.keys(ENTITIES).join('|'), 'g');
function join (array, separator) {
if (separator === undefined || separator === null) {
separator = ','
separator = ',';
}

@@ -31,4 +33,4 @@ if (array.length <= 0) {

constructor (parts, subs) {
this._parts = parts
this._subs = subs
this._parts = parts;
this._subs = subs;
}

@@ -48,3 +50,3 @@

return this._parts.reduce((result, part, i) => {
const sub = this._subs[i - 1]
const sub = this._subs[i - 1];
return result + this._escapeHtml(sub) + part

@@ -63,4 +65,5 @@ })

Object.assign(escapeHtml, { safe, join })
module.exports = escapeHtml
exports.default = escapeHtml;
exports.join = join;
exports.safe = safe;
module.exports = Object.assign(exports.default, exports);
{
"name": "escape-html-template-tag",
"version": "1.1.2",
"version": "1.2.0",
"description": "Tag literal strings with this function to html escape interpolated values",
"main": "index.js",
"module": "index.mjs",
"scripts": {
"test": "standard && node test"
"test": "standard && node test",
"prepublish": "rollup index.mjs --file index.js --format cjs --exports named --no-esModule --footer 'module.exports = Object.assign(exports.default, exports);'"
},

@@ -21,2 +23,3 @@ "repository": {

"index.js",
"index.mjs",
"index.d.ts"

@@ -31,4 +34,5 @@ ],

"devDependencies": {
"standard": "13.1.0"
"rollup": "1.26.0",
"standard": "14.3.1"
}
}
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