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

🚀 Feature: Option to get the valid fields returned? #51

Open
ErisDS opened this issue Jan 17, 2016 · 1 comment
Open

🚀 Feature: Option to get the valid fields returned? #51

ErisDS opened this issue Jan 17, 2016 · 1 comment
Labels
status: in discussion Not yet ready for implementation or a pull request type: feature New enhancement or request 🚀

Comments

@ErisDS
Copy link

ErisDS commented Jan 17, 2016

Hi there, I'm using this module as part of a bigger validator for Ghost themes.

After I've checked that the package.json is valid, I want to use some of the fields to inform my report (name, version, description, etc) and eventually I'd like to add a few extra validations of my own which are Ghost-specific.

At the moment, I end up having to do some work twice. I can't parse the JSON and pass pre-parsed JSON to package.json-validator as it expects a string, but I also don't believe it's currently possible to get the parsed JSON back from PJV to do further work on.

I'm happy to submit a PR, but thought I'd check first, would the option to get the valid JSON back be something that would be accepted? Any thoughts or recommendations on naming or approach?

@JoshuaKGoldberg
Copy link
Owner

I can't parse the JSON and pass pre-parsed JSON to package.json-validator as it expects a string

Indeed, that would be very nice! Tracked in #66 and accepting PRs.

get the valid JSON back

Hmm. I can see a use case for consumers who pass in a string, even after #66 is in. But parsing JSON isn't too expensive -especially given that package.json files tend to not be huge- and adding new fields to the return of the parsing function makes its API a bit more complicated. Unless someone has a real strong use case for it, I'd rather avoid it.

Marking as status: in discussion to wait for someone to post that use case. Cheers!

@JoshuaKGoldberg JoshuaKGoldberg added type: feature New enhancement or request 🚀 status: in discussion Not yet ready for implementation or a pull request labels Mar 28, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title Option to get the valid fields returned? 🚀 Feature: Option to get the valid fields returned? Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in discussion Not yet ready for implementation or a pull request type: feature New enhancement or request 🚀
Projects
None yet
Development

No branches or pull requests

2 participants