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 ownProperties, ownPropertyNames, ownPropertyValues #92

Closed
wants to merge 1 commit into from

Conversation

aleclarson
Copy link
Member

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Add 3 functions that mirror the behavior of Object.entries, Object.keys, and Object.values but do it lazily (via generator) and provide better type inference (see the tests/iterable/*.test-d.ts files for examples).

No benchmarks added, since these implementations are so straight-forward and therefore very unlikely to be optimized.

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

No

@aleclarson aleclarson force-pushed the feat/ownProperty-fns branch from 10449e0 to ef76186 Compare July 7, 2024 22:41
@Minhir
Copy link
Member

Minhir commented Jul 8, 2024

Unfortunately, we can't provide better typings for those functions compared to TS ones. There is an example of unexpected behavior with current types.

@aleclarson
Copy link
Member Author

Closing as per #94

@aleclarson aleclarson closed this Jul 9, 2024
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