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 isEmptyRecord function #357

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

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Feb 5, 2025

Summary

Adds the isEmptyRecord function to check if a plain object has 0 own keys.

Related issue, if any:

https://github.com/orgs/radashi-org/discussions/356

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 .github/next-minor.md or .github/next-major.md have been added, if needed

Does this PR introduce a breaking change?

No

Bundle impact

Status File Size 1
A src/object/isEmptyRecord.ts 120

Footnotes

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

@radashi-bot
Copy link

radashi-bot commented Feb 5, 2025

Benchmark Results

Name Current
isEmptyRecord: empty object 4,770,844.66 ops/sec ±0.13%
isEmptyRecord: object with one property 2,387,765.67 ops/sec ±0.09%
isEmptyRecord: object with multiple properties 2,383,043.41 ops/sec ±0.09%
isEmptyRecord: empty object 2,982,509.25 ops/sec ±0.25%
isEmptyRecord: object with one property 2,980,672.21 ops/sec ±0.09%

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.

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

Successfully merging this pull request may close these issues.

2 participants