Resolve key conflicts with an array of values
var inject = require("multi-keyval")
var obj = {}
inject(obj, "a", 1)
// obj -> { "a": 1 }
inject(obj, "a", 2)
// obj -> { "a": [1, 2] }
// And it works with array values
inject(obj, "b", ["A", "B"])
// obj -> { "a": [1, 2], "b": ["A", "B"] }
inject(obj, "b", ["C", "D"])
// obj -> { "a": [1, 2], "b": [["A", "B"], ["C", "D"]]}
npm install multi-keyval
- Matt-Esch