Skip to content

feat: add @stdlib/utils/some-in-by #1412

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

Conversation

performant23
Copy link
Contributor

Add support to test whether some "own" and inherited properties of a provided object satisfies a predicate function.

Fixes: #825

Resolves #825.

Description

What is the purpose of this pull request?
Add support to test whether some "own" and inherited properties of a provided object satisfies a predicate function.

This pull request:

  • Uses the below conditions to check whether the properties satisfy predicate function.
 Object.prototype.hasOwnProperty.call(obj, key) || Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(obj), key) )

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

Add support to test whether some "own" and inherited properties of a provided object satisfies a predicate function.

Fixes: stdlib-js#825
@Planeshifter Planeshifter self-requested a review February 29, 2024 02:03
Copy link
Member

@Planeshifter Planeshifter 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 getting this done; looks good!

Will merge after CI passed.


## See Also

- <span class="package-name">[`@stdlib/utils/any-by`][@stdlib/utils/any-by]</span><span class="delimiter">: </span><span class="description">test whether at least one element in a collection passes a test implemented by a predicate function.</span>
Copy link
Member

Choose a reason for hiding this comment

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

@performant23 No reason to fill in these; the related packages sections get auto-populated.

Signed-off-by: Philipp Burckhardt <[email protected]>
@Planeshifter Planeshifter merged commit 2351845 into stdlib-js:develop Feb 29, 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.

[RFC]: Add @stdlib/utils/some-in-by
2 participants