a shy attempt to obey width in the beautifier; added bracketize option to always print brackets around if/do/while/for statements; export more options via the CLI
This commit is contained in:
@@ -96,10 +96,17 @@ function repeat_string(str, i) {
|
||||
return d;
|
||||
};
|
||||
|
||||
function defaults(args, defs) {
|
||||
function DefaultsError(msg, defs) {
|
||||
this.msg = msg;
|
||||
this.defs = defs;
|
||||
};
|
||||
|
||||
function defaults(args, defs, croak) {
|
||||
if (args === true)
|
||||
args = {};
|
||||
var ret = args || {};
|
||||
if (croak) for (var i in ret) if (HOP(ret, i) && !HOP(defs, i))
|
||||
throw new DefaultsError("`" + i + "` is not a supported option", defs);
|
||||
for (var i in defs) if (HOP(defs, i)) {
|
||||
ret[i] = (args && HOP(args, i)) ? args[i] : defs[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user