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

feat: add parseHumanDuration and defineHumanQuantityParser functions #332

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hugo082
Copy link

@hugo082 hugo082 commented Dec 26, 2024

Summary

Implement parseHumanDuration and defineHumanQuantityParser functions

Related issue, if any:

Related discussion

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed
  • Release notes in next-minor.md or next-major.md have been added, if needed

Does this PR introduce a breaking change?

No

Bundle impact

Status File Size 1
A src/number/parseHumanDuration.ts 719

Footnotes

  1. Function size includes the import dependencies of the function.

@hugo082 hugo082 requested a review from aleclarson as a code owner December 26, 2024 14:01
Copy link
Contributor

@MarlonPassos-git MarlonPassos-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

A few observations:

  1. Then run the pnpm format command. (It seems that we have a problem with the CI, where it doesn't throw a formatting error, I'll take a look later 😅)
  2. Create a file with the bentchmaks.
  3. And then update the next-minor.md file with the changes from the PR

src/number/parseHumanDuration.ts Outdated Show resolved Hide resolved
src/number/parseHumanDuration.ts Outdated Show resolved Hide resolved
src/number/parseHumanDuration.ts Show resolved Hide resolved
tests/number/parseHumanDuration.test.ts Outdated Show resolved Hide resolved
docs/number/parseHumanDuration.mdx Outdated Show resolved Hide resolved
@radashi-bot
Copy link

Benchmark Results

Name Current
parseHumanDuration: with string 1,102,345.74 ops/sec ±0.63%
parseHumanDuration: with number 2,274,277.4 ops/sec ±0.06%

Performance regressions of 30% or more should be investigated, unless they were anticipated. Smaller regressions may be due to normal variability, as we don't use dedicated CI infrastructure.

@hugo082
Copy link
Author

hugo082 commented Dec 27, 2024

  • Then run the pnpm format command
  • Create a file with the bentchmaks.
  • And then update the next-minor.md file with the changes from the PR

@MarlonPassos-git MarlonPassos-git added the new feature This PR adds a new function or extends an existing one label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants