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

Errors with null or undefined Array decorators #17

Open
tavosansal opened this issue May 13, 2020 · 0 comments
Open

Errors with null or undefined Array decorators #17

tavosansal opened this issue May 13, 2020 · 0 comments

Comments

@tavosansal
Copy link

I noticed that using decorators that have to do with arrays sort and sortBy, if the value provided to the decorator to sort is null or undefined then the decorator errors out at runtime with something similar to cannot call slice() of undefined. I am providing a guarded value now so that the decorator has an empty array as a source at least. But I wonder if the library itself should guard agains these cases? Like maybe do an array check before calling slice here? https://github.com/pzuraq/macro-decorators/blob/master/src/index.ts#L1163

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

No branches or pull requests

1 participant