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

Exception on an empty object #12

Open
eGavr opened this issue Jul 16, 2015 · 4 comments
Open

Exception on an empty object #12

eGavr opened this issue Jul 16, 2015 · 4 comments

Comments

@eGavr
Copy link
Collaborator

eGavr commented Jul 16, 2015

Are you sure that throwing an exception on an empty object in the input is a good solution?

I mean

normalize(undefined) // []

BUT

normalize({}) // throw ERROR

WHY?

Maybe it should be

normalize({}) // []
@iamstarkov
Copy link

valid point, probably undefined should also throw an error

@eGavr
Copy link
Collaborator Author

eGavr commented Jul 16, 2015

I mean that it should be [], but not an error

@eGavr
Copy link
Collaborator Author

eGavr commented Jul 16, 2015

Because {} is a valid declaration and after normalizing it should be []

Yes, probably, normalize(undefined) should throw an error.

@floatdrop
Copy link
Owner

👍

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

3 participants