punycode: update to v1.2.0
This update adds support for RFC 3490 separators for improved compatibility with web browsers.
This commit is contained in:
parent
9668df8b39
commit
bc764f3dff
@ -1,4 +1,4 @@
|
|||||||
/*! http://mths.be/punycode by @mathias */
|
/*! http://mths.be/punycode v1.2.0 by @mathias */
|
||||||
;(function(root) {
|
;(function(root) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,12 +29,13 @@
|
|||||||
delimiter = '-', // '\x2D'
|
delimiter = '-', // '\x2D'
|
||||||
|
|
||||||
/** Regular expressions */
|
/** Regular expressions */
|
||||||
regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
|
|
||||||
regexPunycode = /^xn--/,
|
regexPunycode = /^xn--/,
|
||||||
|
regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
|
||||||
|
regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators
|
||||||
|
|
||||||
/** Error messages */
|
/** Error messages */
|
||||||
errors = {
|
errors = {
|
||||||
'overflow': 'Overflow: input needs wider integers to process.',
|
'overflow': 'Overflow: input needs wider integers to process',
|
||||||
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
||||||
'invalid-input': 'Invalid input'
|
'invalid-input': 'Invalid input'
|
||||||
},
|
},
|
||||||
@ -85,8 +86,7 @@
|
|||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
function mapDomain(string, fn) {
|
function mapDomain(string, fn) {
|
||||||
var glue = '.';
|
return map(string.split(regexSeparators), fn).join('.');
|
||||||
return map(string.split(glue), fn).join(glue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -198,7 +198,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a basic code point to lowercase is `flag` is falsy, or to
|
* Converts a basic code point to lowercase if `flag` is falsy, or to
|
||||||
* uppercase if `flag` is truthy. The code point is unchanged if it's
|
* uppercase if `flag` is truthy. The code point is unchanged if it's
|
||||||
* caseless. The behavior is undefined if `codePoint` is not a basic code
|
* caseless. The behavior is undefined if `codePoint` is not a basic code
|
||||||
* point.
|
* point.
|
||||||
@ -470,7 +470,7 @@
|
|||||||
* @memberOf punycode
|
* @memberOf punycode
|
||||||
* @type String
|
* @type String
|
||||||
*/
|
*/
|
||||||
'version': '1.1.1',
|
'version': '1.2.0',
|
||||||
/**
|
/**
|
||||||
* An object of methods to convert from JavaScript's internal character
|
* An object of methods to convert from JavaScript's internal character
|
||||||
* representation (UCS-2) to decimal Unicode code points, and back.
|
* representation (UCS-2) to decimal Unicode code points, and back.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user