Ibex is an embedded CoffeeScript DSL for picking object(s) from a JSON object given a schema.
object =
name: "Foo"
husband:
name: "Black"
age: 20
How to get "Black"
from object without the painful undefined checking?
- Define an Ibex schema
Ibex = require 'ibex'
husband_name = Ibex
husband:
name: Ibex.pick "Black"
- Apply the schema to the object to get the list of retrieved values.
husband_name object # => ["Black"]
MIT