Skip to content

eschltd/multi-keyval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multi-keyval

build status dependency status coverage report stability index

npm stats

browser support

Resolve key conflicts with an array of values

Example

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"]]}

Installation

npm install multi-keyval

Contributors

  • Matt-Esch

MIT Licenced

About

Resolve key conflicts with an array of values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published