Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unshift return a Sequence instead of an ArrayLikeSequence #222

Open
b4nst opened this issue Oct 8, 2018 · 0 comments · May be fixed by #223
Open

unshift return a Sequence instead of an ArrayLikeSequence #222

b4nst opened this issue Oct 8, 2018 · 0 comments · May be fixed by #223

Comments

@b4nst
Copy link

b4nst commented Oct 8, 2018

Code to reproduce

const Lazy = require('lazy.js');
const als = Lazy([1]);
console.log(als.unshift(3) instanceof Lazy.ArrayLikeSequence);

expected result: true
actual result: false

This is due to the use of concat with an ArrayLikeSequence inside unshift. One dirty way to fix it will be to use toArray() before concat. Although I think it should be wiser to refactor IndexedConcatenatedSequence in order to accept ArrayLikeSequence.

@b4nst b4nst linked a pull request Oct 8, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant