eslint autofix

This commit is contained in:
Thomas Grainger 2016-11-29 00:22:34 +00:00
parent 0d42541860
commit ad730d806b
No known key found for this signature in database
GPG key ID: 995EA0A029283160
60 changed files with 13067 additions and 13014 deletions

View file

@ -7,13 +7,13 @@
*
* @namespace
*/
var Unicode = {
const Unicode = {
/**
* @constant
* @default
*/
PREFIXES: ["\\u", "%u", "U+"],
PREFIXES: ['\\u', '%u', 'U+'],
/**
* Unescape Unicode Characters operation.
@ -22,41 +22,41 @@ var Unicode = {
* @param {Object[]} args
* @returns {string}
*/
run_unescape: function(input, args) {
var prefix = Unicode._prefix_to_regex[args[0]],
regex = new RegExp(prefix+"([a-f\\d]{4,6})", "ig"),
output = "",
m,
i = 0;
while (!!(m = regex.exec(input))) {
run_unescape(input, args) {
let prefix = Unicode._prefix_to_regex[args[0]],
regex = new RegExp(`${prefix}([a-f\\d]{4,6})`, 'ig'),
output = '',
m,
i = 0;
while (m = regex.exec(input)) {
// Add up to match
output += input.slice(i, m.index);
i = m.index;
output += input.slice(i, m.index);
i = m.index;
// Add match
output += Utils.chr(parseInt(m[1], 16));
i = regex.lastIndex;
}
output += Utils.chr(parseInt(m[1], 16));
i = regex.lastIndex;
}
// Add all after final match
output += input.slice(i, input.length);
return output;
},
output += input.slice(i, input.length);
return output;
},
/**
* Lookup table to add prefixes to unicode delimiters so that they can be used in a regex.
*
* @private
* @constant
*/
_prefix_to_regex: {
"\\u": "\\\\u",
"%u": "%u",
"U+": "U\\+"
},
_prefix_to_regex: {
'\\u': '\\\\u',
'%u': '%u',
'U+': 'U\\+',
},
};