Skip to content

Commit

Permalink
A couple edits for consistency
Browse files Browse the repository at this point in the history
used hasOwnProperty rather than comparison, made it easier to read
  • Loading branch information
trevorfox committed Aug 15, 2017
1 parent 8adb01e commit 872f3f8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/groucho.js
Expand Up @@ -22,14 +22,14 @@ var groucho = window.groucho || {};
'addons': {}
};

// If config property is not set, use defaults.
if (groucho.config === undefined){
groucho.config = groucho.defaults;
// Handle empty config.
if (!groucho.hasOwnProperty(config) {
groucho.config = groucho.defaults;
} else {
// Else set empty configs to defaults.
for (var config in defaults) {
if (!groucho.config.hasOwnProperty(config)) {
groucho.config[config] = defaults[config];
// Set empty configs to defaults.
for (var setting in defaults) {
if (!groucho.config.hasOwnProperty(setting)) {
groucho.config[setting] = defaults[setting];
}
}
}
Expand Down

0 comments on commit 872f3f8

Please sign in to comment.