diff options
Diffstat (limited to 'bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-unicode.js')
-rw-r--r-- | bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-unicode.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-unicode.js b/bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-unicode.js new file mode 100644 index 00000000..9e83b625 --- /dev/null +++ b/bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-unicode.js @@ -0,0 +1,25 @@ +'use strict'; + +var mapDomain = require('./lib/map-domain') + , decode = require('./decode') + + , regexPunycode = /^xn--/; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. +*/ +module.exports = function (input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; |