Sha256: 5da93fd52203bfc4d63c37833d67fea2be4d2700b591d802093f11f5301fe343
Contents?: true
Size: 779 Bytes
Versions: 88
Compression:
Stored size: 779 Bytes
Contents
"use strict"; exports.__esModule = true; exports.default = unesc; var whitespace = '[\\x20\\t\\r\\n\\f]'; var unescapeRegExp = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig'); function unesc(str) { return str.replace(unescapeRegExp, function (_, escaped, escapedWhitespace) { var high = '0x' + escaped - 0x10000; // NaN means non-codepoint // Workaround erroneous numeric interpretation of +"0x" // eslint-disable-next-line no-self-compare return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode(high + 0x10000) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode(high >> 10 | 0xd800, high & 0x3ff | 0xdc00); }); } module.exports = exports.default;
Version data entries
88 entries across 50 versions & 10 rubygems