0.0.3 • Published 7 years ago

lense v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Lenses for javascript.

Minimal, and no external dependencies (except for building/testing).

#Licensing See the license for licensing.

#Example

var Lense = require('lense').Lense
lense = Lense.parse('foo.bar[1].a')

obj = {
  "foo": {
    "bar": [
      1,
      { "a": 2 }
    ]
  }
}

console.log(lense.get(obj)) // > 2
lense.set(obj, 4000)
console.log(lense.get(obj)) // > 4000

#Documentation See the source for more documentation.