I think the library shouldn't generate multiple alias (jl, jlinq, jLinq), If the user wants to use an abbreviation it's better that he creates an alias inside his scope:
//closure to avoid polluting global scope and also generates alias to jlinq object
//since I'm going to call it a lot of times
(function(jl){
var result = jl.from(myData).contains('awesome', true).select();
var result2 = jl.from...
}(jlinq));
or:
function doManyQueries(){
var jl = jlinq; //local alias
var result = jl.from(myData).contains('awesome', true).select();
var result2 = jl.from...
}
if you have some legacy code that uses the alias is very easy to fix it, just by adding the property to the global scope, if documented it should be hard to follow:
//create global alias for backward compatibility
window.jl = jlinq;
I think the library shouldn't generate multiple alias (
jl
,jlinq
,jLinq
), If the user wants to use an abbreviation it's better that he creates an alias inside his scope:or:
if you have some legacy code that uses the alias is very easy to fix it, just by adding the property to the global scope, if documented it should be hard to follow: