Giter Site home page Giter Site logo

fromjs's People

Contributors

calebboyd avatar hsynemus avatar skgmn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fromjs's Issues

fromjs no "indexOf" function

var arr2 = [
{name: "a", color: "yellow"},
{name: "b", color: "red"},
{name: "c", color: "blue"},
{name: "c", color: "blue"}
];
var val2 = from(arr2).indexOf("$color==@","red");

//result:val2=1

Set function context

A nice feature, though It might affect performance (minimal), would be the ability to set function execution context (this). In other words in ***Iterable.prototype.each functions using f.call(context,arg1,arg2,arg3,) instead of f(arg1,arg2,arg3) and similarly with non-eval'd proc lambdas. I can submit a pull request if this is something you might consider!

SelectMany+Concat Error

var petOwners = [
{ name: "ab", pets: [ "a", "b" ] },
{ name: "cd", pets: [ "c", "d" ] },
{ name: "ef", pets: [ "e", "f" ] }
];
from(petOwners).selectMany("$pets").concat(["x","y"]).toArray();

result:["a", "b", "c", "d", "e", "f"]
not ["a", "b", "c", "d", "e", "f", "x", "y"]

singleOrDefault

The sequence has more than one element satisfying the condition. I am very sure that my list of strings, which I inspect with break points in webstorm does not contain multiple objects which satisfy the condition.

var type = 'subst';
var filePaths = ['./lib/hangman/wordlists/adv.nor.wordlist.txt',
                 './lib/hangman/wordlists/subst.nor.wordlist.txt']

var path = from(filePaths).singleOrDefault(function(x){ return S(x).contains('/' + type + '.'); });

the error thrown is "The sequence has more than one element satisfying the condition";

var path = from(filePaths).singleOrDefault(function(x){ return x.indexOf(type) !== -1; });

this live gives the same result.

Cannot Re-enumerate

I'm not sure if this is the intended functionality but since lazy evaluation is already in place. The following snippet might be expected to have ['value'] as it's output

var array = [];
var x = from(array);
x.toArray();
//-->[]
array.push('value');
x.data
//-->['value']
x.toArray();
//-->[]
//ideal output of toArray() would reflect x.data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.