X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Funescape.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Funescape.js;h=8f109030583dfe9e1c846830227fcdcc7757b865;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/unescape.js b/node_modules/uncss/node_modules/lodash/unescape.js new file mode 100644 index 000000000..8f1090305 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/unescape.js @@ -0,0 +1,33 @@ +var toString = require('./toString'), + unescapeHtmlChar = require('./internal/unescapeHtmlChar'); + +/** Used to match HTML entities and HTML characters. */ +var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source); + +/** + * The inverse of `_.escape`; this method converts the HTML entities + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their + * corresponding characters. + * + * **Note:** No other HTML entities are unescaped. To unescape additional HTML + * entities use a third-party library like [_he_](https://mths.be/he). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to unescape. + * @returns {string} Returns the unescaped string. + * @example + * + * _.unescape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ +function unescape(string) { + string = toString(string); + return (string && reHasEscapedHtml.test(string)) + ? string.replace(reEscapedHtml, unescapeHtmlChar) + : string; +} + +module.exports = unescape;