mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 15:47:58 +01:00
Fix some JS warnings.
This commit is contained in:
@@ -222,11 +222,10 @@ const Command = Class("Command", {
|
||||
* @param {Array} specs An array of command name specs to parse.
|
||||
* @returns {Array}
|
||||
*/
|
||||
parseSpecs: function (specs) {
|
||||
parseSpecs: function parseSpecs(specs) {
|
||||
return specs.map(function (spec) {
|
||||
let long = spec.replace(/[[\]]/g, "");
|
||||
let short = spec.replace(/\[.*]/, "");
|
||||
return short == long ? [long] : [long, short];
|
||||
let [, head, tail] = spec.match(/(\w+)(?:\[(.*)])?/);
|
||||
return tail ? [head + tail, head] : [head];
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user