option-select-action
Advanced tools
Comparing version 0.3.0 to 1.0.0
@@ -8,3 +8,3 @@ var slice = Array.prototype.slice | ||
opts = opts || {} | ||
opts.keyField = opts.keyField || 'id' | ||
opts.keyField = opts.keyField || 'value' | ||
@@ -11,0 +11,0 @@ return { |
{ | ||
"name": "option-select-action", | ||
"description": "add an option object to a value array or call a fuction based on the object's properties", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "url": "nrw/option-select-action" |
@@ -17,14 +17,14 @@ var test = require('tape') | ||
store.select({id: 'six'}) | ||
t.same(store.value(), [{}, {id: 'six'}]) | ||
store.select({value: 'six'}) | ||
t.same(store.value(), [{}, {value: 'six'}]) | ||
t.equal(i, 0) | ||
store.select({id: 'inc'}) | ||
store.select({value: 'inc'}) | ||
t.equal(i, 1) | ||
t.same(store.value(), [{}, {id: 'six'}]) | ||
t.same(store.value(), [{}, {value: 'six'}]) | ||
store.select({id: 'inc'}) | ||
store.select({value: 'inc'}) | ||
t.equal(i, 2) | ||
t.same(store.pop(), {id: 'six'}) | ||
t.same(store.pop(), {value: 'six'}) | ||
t.same(store.value(), [{}]) | ||
@@ -45,16 +45,16 @@ store.pop() | ||
initial = [{_id: 'eight'}] | ||
store = SelectAction(actions, initial, {keyField: '_id'}) | ||
t.same(store.value(), [{_id: 'eight'}]) | ||
initial = [{_value: 'eight'}] | ||
store = SelectAction(actions, initial, {keyField: '_value'}) | ||
t.same(store.value(), [{_value: 'eight'}]) | ||
store.select({_id: 'one'}) | ||
t.same(store.value(), [{_id: 'eight'}, {_id: 'one'}]) | ||
store.select({_value: 'one'}) | ||
t.same(store.value(), [{_value: 'eight'}, {_value: 'one'}]) | ||
t.equal(i, 0) | ||
store.select({_id: 'inc'}) | ||
store.select({_value: 'inc'}) | ||
t.equal(i, 1) | ||
t.same(store.value(), [{_id: 'eight'}, {_id: 'one'}]) | ||
t.same(store.value(), [{_value: 'eight'}, {_value: 'one'}]) | ||
store.select({_id: 'dec'}) | ||
t.same(store.value(), [{_id: 'eight'}, {_id: 'one'}]) | ||
store.select({_value: 'dec'}) | ||
t.same(store.value(), [{_value: 'eight'}, {_value: 'one'}]) | ||
t.equal(i, 0) | ||
@@ -69,3 +69,3 @@ | ||
actions = { | ||
add: function (obj, a, b) { i += obj.id + a + b } | ||
add: function (obj, a, b) { i += obj.value + a + b } | ||
} | ||
@@ -75,3 +75,3 @@ | ||
store.select({id: 'add'}, 'one', 'two') | ||
store.select({value: 'add'}, 'one', 'two') | ||
t.equal(i, 'addonetwo') | ||
@@ -78,0 +78,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3462
1