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

[QUESTION] Is it correct to "throw" on invalid name and/or invalid version? #6

Open
myrne opened this issue Apr 8, 2013 · 0 comments
Labels

Comments

@myrne
Copy link
Contributor

myrne commented Apr 8, 2013

In original async code, callback was immediately called with an error object

                var ret = validName(file, data)
                if (ret !== true) return cb(ret);
                ret = validVersion(file, data)
                if (ret !== true) return cb(ret);

I wonder if this is desirable if this function would be used inside npm-www for example. If requirements for name or versions get more strict (I admit, maybe far-fetched) the whole normalization process stops. Considering the packageData is modified in-place, the data after the throw is then unnormalized (or half-normalized, depending on where the throw happened).

@darcyclarke darcyclarke changed the title Is it correct to "throw" on invalid name and/or invalid version? [QUESTION] Is it correct to "throw" on invalid name and/or invalid version? Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants