Skip to content

Commit

Permalink
Rename grouped to arrayed.
Browse files Browse the repository at this point in the history
  • Loading branch information
flatheadmill committed Jun 10, 2018
1 parent 31ad7a7 commit 1b49b0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions program.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,20 @@ Program.prototype._setParameters = function (parameters) {
}).filter(function (value, index, arrayj) {
return arrayj.indexOf(value) == index
})
this.grouped = {}
this.arrayed = {}
this.arguable.forEach(function (name) {
this.grouped[name] = []
this.arrayed[name] = []
}, this)
this.parameters.forEach(function (parameter) {
var group = this.grouped[parameter.name]
var group = this.arrayed[parameter.name]
if (group == null) {
group = this.grouped[parameter.name] = []
group = this.arrayed[parameter.name] = []
}
group.push(parameter.value)
}, this)
this.ultimate = {}
this.given.forEach(function (key) {
this.ultimate[key] = this.grouped[key][this.grouped[key].length - 1]
this.ultimate[key] = this.arrayed[key][this.arrayed[key].length - 1]
}, this)
}

Expand Down
4 changes: 2 additions & 2 deletions t/program.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ function prove (async, assert) {
createProgram(__filename, {}, [ '-cone=1', '-c', 'two=2' ], {
}, cadence(function (async, program) {
assert(program.given, [ 'config' ], 'given')
assert(program.grouped, {
assert(program.arrayed, {
config: [ 'one=1', 'two=2' ],
level: [],
processes: [ ],
bind: []
}, 'grouped')
}, 'arrayed')
assert(program.ultimate, { config: 'two=2' }, 'ultimate')
assert(!program.terminal, 'not terminal')
}), null, function (error) {
Expand Down

0 comments on commit 1b49b0c

Please sign in to comment.