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

escape-goat

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

escape-goat - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

18

index.js

@@ -16,1 +16,19 @@ 'use strict';

.replace(/>/g, '>');
exports.escapeTag = function (input) {
const values = [].slice.call(arguments, 1);
let output = input[0];
for (let i = 0; i < values.length; i++) {
output = output + exports.escape(values[i]) + input[i + 1];
}
return output;
};
exports.unescapeTag = function (input) {
const values = [].slice.call(arguments, 1);
let output = input[0];
for (let i = 0; i < values.length; i++) {
output = output + exports.unescape(values[i]) + input[i + 1];
}
return output;
};

2

package.json
{
"name": "escape-goat",
"version": "1.1.0",
"version": "1.2.0",
"description": "Escape a string for use in HTML or the inverse",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -30,2 +30,6 @@ <h1>

//=> 'Hello &lt;em&gt;World&lt;/em&gt;'
const url = 'https://sindresorhus.com?x="🦄"';
escapeGoat.escapeTag`<a href="${url}">Unicorn</a>`;
//=> '<a href="https://sindresorhus.com?x=&quot;🦄&quot;">Unicorn</a>'
```

@@ -40,7 +44,14 @@

### escapeGoat.unescape(html)
### escapeGoat.unescape(input)
Unescapes the following HTML entities in the given `input` string: `&amp;` `&lt;` `&gt;` `&quot;` `&#39;`
### escapeGoat.escapeTag
[Tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that escapes interpolated values.
### escapeGoat.unescapeTag
[Tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that unescapes interpolated values.
## Tip

@@ -47,0 +58,0 @@

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