|
1 | | -/*! http://mths.be/punycode by @mathias */ |
| 1 | +/*! http://mths.be/punycode v1.2.0 by @mathias */ |
2 | 2 | ;(function(root) { |
3 | 3 |
|
4 | 4 | /** |
|
29 | 29 | delimiter = '-', // '\x2D' |
30 | 30 |
|
31 | 31 | /** Regular expressions */ |
32 | | - regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars |
33 | 32 | regexPunycode = /^xn--/, |
| 33 | + regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars |
| 34 | + regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators |
34 | 35 |
|
35 | 36 | /** Error messages */ |
36 | 37 | errors = { |
37 | | - 'overflow': 'Overflow: input needs wider integers to process.', |
| 38 | + 'overflow': 'Overflow: input needs wider integers to process', |
38 | 39 | 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', |
39 | 40 | 'invalid-input': 'Invalid input' |
40 | 41 | }, |
|
85 | 86 | * function. |
86 | 87 | */ |
87 | 88 | function mapDomain(string, fn) { |
88 | | - var glue = '.'; |
89 | | - return map(string.split(glue), fn).join(glue); |
| 89 | + return map(string.split(regexSeparators), fn).join('.'); |
90 | 90 | } |
91 | 91 |
|
92 | 92 | /** |
|
198 | 198 | } |
199 | 199 |
|
200 | 200 | /** |
201 | | - * Converts a basic code point to lowercase is `flag` is falsy, or to |
| 201 | + * Converts a basic code point to lowercase if `flag` is falsy, or to |
202 | 202 | * uppercase if `flag` is truthy. The code point is unchanged if it's |
203 | 203 | * caseless. The behavior is undefined if `codePoint` is not a basic code |
204 | 204 | * point. |
|
470 | 470 | * @memberOf punycode |
471 | 471 | * @type String |
472 | 472 | */ |
473 | | - 'version': '1.1.1', |
| 473 | + 'version': '1.2.0', |
474 | 474 | /** |
475 | 475 | * An object of methods to convert from JavaScript's internal character |
476 | 476 | * representation (UCS-2) to decimal Unicode code points, and back. |
|
0 commit comments