question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`@hapi/joi` dependency - necessary?

See original GitHub issue

Just evaluating this lib for use in a project and the one issue that stood out for me was the dependency on @hapi/joi, which has a chain of various dependencies.

This is only used in src for validateEvent. This isn’t exported or part of the package’s public API, but it’s used as part of createEvent. Is it really necessary to validate the package’s output at runtime? Seems like more of a job for unit tests.

If it’s possible to move @hapi/joi into devDependencies and drop this runtime check that’d be a nice win (and presumably also a good performance boost for createEvent, if that matters)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
adamgibbonscommented, Sep 17, 2020

Great suggestion, I’ll take a look

3reactions
adamgibbonscommented, Jun 5, 2021

Heard and merged!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency Problem with "@hapi/joi" · Issue #19 - GitHub
Regarding peer dependency, the dependency on @hapi/joi is self contained and isolated within the module. As such, the typical use case of ...
Read more >
@hapi/joi - npm
a required string · must contain only alphanumeric characters · at least 3 characters long but no more than 30 · must be...
Read more >
Validation - hapi.dev
First, joi states that post must be a minimum of 1 character, and a maximum of 140 characters. It also states that date...
Read more >
How to properly share Hapi Joi validation schemas between ...
I found the easy way would be to centralize all schemas in a single file that could be required in all validators, but...
Read more >
@hapi/joi - npm Package Health Analysis | Snyk
All security vulnerabilities belong to production dependencies of direct and indirect packages. ... We found a way for you to contribute to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found