mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 16:04:12 +01:00
Simplifyification.
This commit is contained in:
@@ -350,7 +350,9 @@ var Abbreviations = Module("abbreviations", {
|
||||
command: this.name,
|
||||
arguments: [abbr.lhs],
|
||||
literalArg: abbr.rhs,
|
||||
options: callable(abbr.rhs) ? {"-javascript": null} : {}
|
||||
options: {
|
||||
"-javascript": abbr.rhs ? null : undefined
|
||||
}
|
||||
}
|
||||
for ([, abbr] in Iterator(abbreviations.user.merged))
|
||||
if (abbr.modesEqual(modes))
|
||||
|
||||
@@ -625,15 +625,13 @@ var Mappings = Module("mappings", {
|
||||
.map(function (hive) [
|
||||
{
|
||||
command: "map",
|
||||
options: array([
|
||||
hive.name !== "user" && ["-group", hive.name],
|
||||
map.count && ["-count"],
|
||||
["-modes", uniqueModes(map.modes)],
|
||||
["-description", map.description],
|
||||
map.silent && ["-silent"]])
|
||||
|
||||
.filter(util.identity)
|
||||
.toObject(),
|
||||
options: {
|
||||
"-count": map.count ? null : undefined,
|
||||
"-description": map.description,
|
||||
"-group": hive.name == "user" ? undefined : hive.name,
|
||||
"-modes": uniqueModes(map.modes),
|
||||
"-silent": map.silent ? null : undefined
|
||||
},
|
||||
arguments: [map.names[0]],
|
||||
literalArg: map.rhs,
|
||||
ignoreDefaults: true
|
||||
|
||||
@@ -628,9 +628,10 @@ var Styles = Module("Styles", {
|
||||
command: "style",
|
||||
arguments: [style.sites.join(",")],
|
||||
literalArg: style.css,
|
||||
options: update(
|
||||
hive.name == "user" ? {} : { "-group": hive.name },
|
||||
style.name ? { "-name": style.name } : {})
|
||||
options: {
|
||||
"-group": hive.name == "user" ? undefined : hive.name,
|
||||
"-name": style.name || undefined
|
||||
}
|
||||
})))
|
||||
.flatten().array
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user