From 79b498d8f246362657727f338a8948302a3eddfe Mon Sep 17 00:00:00 2001 From: Haralampieva <41107923+venetah@users.noreply.github.com> Date: Wed, 11 Jul 2018 11:47:42 +0100 Subject: [PATCH] punycode: named anonymous functions --- lib/punycode.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/punycode.js b/lib/punycode.js index 34da3ca5ad13b6..6a11a975710cb4 100644 --- a/lib/punycode.js +++ b/lib/punycode.js @@ -141,7 +141,7 @@ const ucs2encode = array => String.fromCodePoint(...array); * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ -const basicToDigit = function(codePoint) { +const basicToDigit = function basicToDigit(codePoint) { if (codePoint - 0x30 < 0x0A) { return codePoint - 0x16; } @@ -165,7 +165,7 @@ const basicToDigit = function(codePoint) { * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ -const digitToBasic = function(digit, flag) { +const digitToBasic = function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); @@ -176,7 +176,7 @@ const digitToBasic = function(digit, flag) { * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ -const adapt = function(delta, numPoints, firstTime) { +const adapt = function adapt(delta, numPoints, firstTime) { let k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); @@ -193,7 +193,7 @@ const adapt = function(delta, numPoints, firstTime) { * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ -const decode = function(input) { +const decode = function decode(input) { // Don't use UCS-2. const output = []; const inputLength = input.length; @@ -284,7 +284,7 @@ const decode = function(input) { * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ -const encode = function(input) { +const encode = function encode(input) { const output = []; // Convert the input in UCS-2 to an array of Unicode code points. @@ -383,7 +383,7 @@ const encode = function(input) { * @returns {String} The Unicode representation of the given Punycode * string. */ -const toUnicode = function(input) { +const toUnicode = function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) @@ -402,7 +402,7 @@ const toUnicode = function(input) { * @returns {String} The Punycode representation of the given domain name or * email address. */ -const toASCII = function(input) { +const toASCII = function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string)