Skip to content

Commit bc764f3

Browse files
mathiasbynensbnoordhuis
authored andcommitted
punycode: update to v1.2.0
This update adds support for RFC 3490 separators for improved compatibility with web browsers.
1 parent 9668df8 commit bc764f3

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/punycode.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! http://mths.be/punycode by @mathias */
1+
/*! http://mths.be/punycode v1.2.0 by @mathias */
22
;(function(root) {
33

44
/**
@@ -29,12 +29,13 @@
2929
delimiter = '-', // '\x2D'
3030

3131
/** Regular expressions */
32-
regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
3332
regexPunycode = /^xn--/,
33+
regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
34+
regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators
3435

3536
/** Error messages */
3637
errors = {
37-
'overflow': 'Overflow: input needs wider integers to process.',
38+
'overflow': 'Overflow: input needs wider integers to process',
3839
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
3940
'invalid-input': 'Invalid input'
4041
},
@@ -85,8 +86,7 @@
8586
* function.
8687
*/
8788
function mapDomain(string, fn) {
88-
var glue = '.';
89-
return map(string.split(glue), fn).join(glue);
89+
return map(string.split(regexSeparators), fn).join('.');
9090
}
9191

9292
/**
@@ -198,7 +198,7 @@
198198
}
199199

200200
/**
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
202202
* uppercase if `flag` is truthy. The code point is unchanged if it's
203203
* caseless. The behavior is undefined if `codePoint` is not a basic code
204204
* point.
@@ -470,7 +470,7 @@
470470
* @memberOf punycode
471471
* @type String
472472
*/
473-
'version': '1.1.1',
473+
'version': '1.2.0',
474474
/**
475475
* An object of methods to convert from JavaScript's internal character
476476
* representation (UCS-2) to decimal Unicode code points, and back.

0 commit comments

Comments
 (0)