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

ArraySchema.splice() items to insert are ignored #101

Closed
larsschwegmann opened this issue Jan 21, 2021 · 3 comments
Closed

ArraySchema.splice() items to insert are ignored #101

larsschwegmann opened this issue Jan 21, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@larsschwegmann
Copy link

I'm trying to replace a value in an ArraySchema at a certain position. The obvious choice was the splice()method.

After looking at the code, it seems that the third argument is completely ignored by the splice implementation. Is this intended? The documentation clearly states "Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.".

Also, the JS Array splice method allows for replacing elements. I would suggest adding support for replacing items or changing the method signature + documentation, because that behavior seems pretty confusing.

@endel
Copy link
Member

endel commented Jan 21, 2021

Hi @larsschwegmann, this is still a missing feature on ArraySchema#splice(). Pull requests are welcome to include this feature on @colyseus/schema. Cheers!

@endel endel added the enhancement New feature or request label Jan 21, 2021
@sylvainpolletvillard
Copy link
Contributor

I think I fixed it with #159

@endel
Copy link
Member

endel commented Jan 2, 2024

Oh right! Thank you @sylvainpolletvillard, let's close this :D Happy new year! ✨

@endel endel closed this as completed Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants