1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-29 03:52:26 +01:00

ES6-ify some things. Still a long way to go...

This commit is contained in:
Kris Maglione
2015-12-20 02:02:54 -08:00
parent 65725c9516
commit 27cdeb1885
28 changed files with 411 additions and 303 deletions

View File

@@ -366,23 +366,21 @@ var Abbreviations = Module("abbreviations", {
}
],
serialize: function () {
return Ary(abbreviations.userHives)
return abbreviations.userHives
.filter(h => h.persist)
.map(hive => [
{
command: this.name,
arguments: [abbr.lhs],
literalArg: abbr.rhs,
options: {
"-group": hive.name == "user" ? undefined : hive.name,
"-javascript": callable(abbr.rhs) ? null : undefined
}
}
for (abbr of hive.merged)
if (abbr.modesEqual(modes))
]).
flatten().array;
}
.flatMap(hive =>
hive.merged
.filter(abbr => abbr.modesEqual(modes))
.map(abbr => ({
command: this.name,
arguments: [abbr.lhs],
literalArg: abbr.rhs,
options: {
"-group": hive.name == "user" ? undefined : hive.name,
"-javascript": callable(abbr.rhs) ? null : undefined
}
})));
},
});
commands.add([ch + "una[bbreviate]"],