Created
January 16, 2015 20:22
-
-
Save alexserver/26abfea54e58d420acf1 to your computer and use it in GitHub Desktop.
sift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sift = require("sift"); | |
// var torender = [ { keypath: 'employee', | |
// template: '{{first_name}} {{ last_name }}' }, | |
// { keypath: 'employee.division', template: '{{division}}' }, | |
// { keypath: 'certificate_type', | |
// template: '{{#peoplesoft_id}}{{peoplesoft_id}}: {{/peoplesoft_id}}{{title}}' } ]; | |
var objects = [ | |
{n: 3}, | |
{n: 6}, | |
{n: 9}, | |
{n: 12}, | |
{n: 15}, | |
{n: 18} | |
]; | |
var result; | |
result = sift({n: 24}, objects, function(i){ | |
console.log(i); | |
i.n = i.n*2; | |
return i; | |
}); | |
console.log(result); | |
// var wawa = sift({keypath: 'employee.division'}, torender); | |
// console.log("wawa ", wawa); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment