nmaguiar / nlinq Goto Github PK
View Code? Open in Web Editor NEWProvide JavaScript abstraction over different ways of "querying" arrays of maps/objects
License: Apache License 2.0
Provide JavaScript abstraction over different ways of "querying" arrays of maps/objects
License: Apache License 2.0
Currently the limit, head and tail apply to the original source but it's "more intuitive" that they are applied to the end result set.
Problem
By default nLinq will be case insensitive:
> $from(["hello"]).equals("HELLO").any()
> false
but when setting useCase to true:
> $from(["hello"]).useCase(true).equals("HELLO").any()
> true
the result should be false.
Add the JLinq join method.
Problem
When using $from under a map with a null entry an error equivalent to:
TypeError: Cannot set property "_key" of null to "b"
occurs.
Steps to reproduce:
var o = { a: 1, b: null, c: 2 };
$from(o)
Problem
When sorting by field names with spaces it outputs the error "missing ) in parenthetical"
Problem
Fails whenever trying to search a double dollar string. Example:
$from(["$$.g", "$$.s"]).equals("$$.g").count() // returns 0
In several cases is useful to sort an array by date but the field might not be a date type. So you end up doing this:
$from(array_of_data)
.attach(“date2”, r => new Date(r.date))
.sort(“date2”)
.select(r => ({ filename: r.filename, date: r.date2 })
It would be more practical and simple just to do:
$from(array_of_data)
.toDate(“date”)
.sort(“date”)
.select({ filename: “n/a”, date: “” })
Be able to reference sub-maps and arrays using OpenAFSigil $$().get().
Example:
_from( anArray )
.equals("names.firstName", "Joe")
.select()
Add the JLinq take, skip and skipTake methods.
It’s already possible to map which fields to will be returned has a result:
// Providing the defaults
$from(array_of_data).select({ field1: “n/a”, field2: 0 })
// OR
$from(array_of_data).select(r => ({ f1: r.field1, field2: r.field2 }))
But it could be more practical to have an array of keys to do the same as the last function option:
$from(array_of_data).select([ “f1:field1”, “field2” ])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.