guionbajo
v1.1.6
Published
Compare object using objcompare by Gustavo Garcia
Downloads
19
Maintainers
Readme
guionbajo _ is a object compare module
by garciacom
Guionbajo is a tool to compare object in your proyects, is a simple tool to make coding easy for you and your company, guionbajo has many features search, find, filter an many more, please follow me and let me know how this tool is helping you.
Web: garciacom.net
Twitter: Garciacom_
Facebook: Garciacom
Functions:
_.filter(find,from)
// filter a array of objects
_.hasKeys(find,from)
// check if find and from keys are same
_.hasValues(find,from)
// check if keys and values are the same
_.search(string)
// search if has value and lowercase or uppercase
_.find(string)
// find value in 1 or more objects
_.between(0,100)
// help to return value between numbers
_.any()
// help to skip that object
Installation:
$ npm install guionbajo --save
Example:
var _ = require('guionbajo');
var team = _.find("Broncos");
var match = {
teamA:team,
teamB:team,
scoreA:_.between(0,100)
};
var matches = [
{
teamA:"NY Giants",
teamB:"Broncos",
scoreA:32,
scoreB:24
},
{
teamA:"NY Giants",
teamB:"Eagles",
scoreA:22,
scoreB:25
}
];
console.log(_.filter(matches, match));