html-escaper
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -41,5 +41,6 @@ 'use strict'; | ||
* Safely escape HTML entities such as `&`, `<`, `>`, `"`, and `'`. | ||
* @param {string|number|boolean} es the input to safely escape | ||
* @returns {string} the escaped input, and it throws an error if | ||
* the input type is unexpected | ||
* @param {string} es the input to safely escape | ||
* @returns {string} the escaped input, and it **throws** an error if | ||
* the input type is unexpected, except for boolean and numbers, | ||
* converted as string. | ||
*/ | ||
@@ -69,6 +70,7 @@ const escape = es => replace.call(es, ca, pe); | ||
* @param {string} un a previously escaped string | ||
* @returns {string} the unescaped input, and it throws an error if | ||
* the input type is unexpected | ||
* @returns {string} the unescaped input, and it **throws** an error if | ||
* the input type is unexpected, except for boolean and numbers, | ||
* converted as string. | ||
*/ | ||
const unescape = un => replace.call(un, es, cape); | ||
exports.unescape = unescape; |
@@ -40,5 +40,6 @@ /** | ||
* Safely escape HTML entities such as `&`, `<`, `>`, `"`, and `'`. | ||
* @param {string|number|boolean} es the input to safely escape | ||
* @returns {string} the escaped input, and it throws an error if | ||
* the input type is unexpected | ||
* @param {string} es the input to safely escape | ||
* @returns {string} the escaped input, and it **throws** an error if | ||
* the input type is unexpected, except for boolean and numbers, | ||
* converted as string. | ||
*/ | ||
@@ -67,5 +68,6 @@ export const escape = es => replace.call(es, ca, pe); | ||
* @param {string} un a previously escaped string | ||
* @returns {string} the unescaped input, and it throws an error if | ||
* the input type is unexpected | ||
* @returns {string} the unescaped input, and it **throws** an error if | ||
* the input type is unexpected, except for boolean and numbers, | ||
* converted as string. | ||
*/ | ||
export const unescape = un => replace.call(un, es, cape); |
12
index.js
@@ -43,5 +43,6 @@ var html = (function (exports) { | ||
* Safely escape HTML entities such as `&`, `<`, `>`, `"`, and `'`. | ||
* @param {string|number|boolean} es the input to safely escape | ||
* @returns {string} the escaped input, and it throws an error if | ||
* the input type is unexpected | ||
* @param {string} es the input to safely escape | ||
* @returns {string} the escaped input, and it **throws** an error if | ||
* the input type is unexpected, except for boolean and numbers, | ||
* converted as string. | ||
*/ | ||
@@ -70,4 +71,5 @@ const escape = es => replace.call(es, ca, pe); | ||
* @param {string} un a previously escaped string | ||
* @returns {string} the unescaped input, and it throws an error if | ||
* the input type is unexpected | ||
* @returns {string} the unescaped input, and it **throws** an error if | ||
* the input type is unexpected, except for boolean and numbers, | ||
* converted as string. | ||
*/ | ||
@@ -74,0 +76,0 @@ const unescape = un => replace.call(un, es, cape); |
{ | ||
"name": "html-escaper", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "fast and safe way to escape and unescape &<>'\" chars", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
15241
219