Message from JavaScript discussions
November 2017
— Will make it possible to have an indexing ORM database kind of thing
Now I am thinking I'll write something that consumes the output of those functions... it is quite literally just an array of accessors, or an array of arrays of accessors, used to traverse linearly
— FindPath -> find
findPaths -> filter
— Taken
— Crap
— Both those already exist in the lib
— They are just "deep" versions of the functions you have in Array.prototype
— Nice
—
var subject = {
people: [
{
name: "Jon Snow",
number: 5555555555
},
{
name: "John Madden",
number: 1231231234
},
{
name: "Jimmy Neutron",
number: 0001112222
}
],
peopleCount: 3
};
// Will clone all numbers and their paths into a new Object
var copy = differentia.filter(subject, function (currentValue, accessor, subject) {
return typeof currentValue === "number";
});
console.log(copy);
// Logs:
/*
{
"peopleCount": 3,
"people": [
{
"number": 5555555555
},
{
"number": 1231231234
},
{
"number": 0001112222
}
]
}
*/
— Could it be namespaced? .paths.find!
— Ehh, that might be... Messy
— Nevermind