diff options
Diffstat (limited to 'bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-ascii.js')
-rw-r--r-- | bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-ascii.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-ascii.js b/bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-ascii.js new file mode 100644 index 00000000..a56a332c --- /dev/null +++ b/bin/wiki/ImportarDesdeURL/node_modules/punycode2/to-ascii.js @@ -0,0 +1,25 @@ +'use strict'; + +var mapDomain = require('./lib/map-domain') + , encode = require('./encode') + + , regexNonASCII = /[^\x20-\x7E]/; // unprintable ASCII chars + non-ASCII chars + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. +*/ +module.exports = function (input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; |