Fold utilities
constructFold in a constructor to instantiate with data.
function Model(data){
this.data = data;
}
when.resolve({ hello: 'world' })
.fold(construct, Model)
.then(function(model){
// `model` is an instance of Model
});
reachFold in a deep object path to extract from data.
var data = {
some: {
deep: {
prop: 'hello world'
}
}
};
when.resolve(data)
.fold(reach, 'some.deep.prop')
.then(function(val){
// `val` is 'hello world'
});
origamiIf you are looking for the old version of origami, please use npm install origami@0.1.0.