Skip to content

Instantly share code, notes, and snippets.

@alexserver
Created January 16, 2015 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexserver/26abfea54e58d420acf1 to your computer and use it in GitHub Desktop.
Save alexserver/26abfea54e58d420acf1 to your computer and use it in GitHub Desktop.
sift
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