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 utils/some-own-by #1437

Conversation

performant23
Copy link
Contributor

@performant23 performant23 commented Mar 1, 2024

Add a utility to test whether some own properties of a provided object satisfies a predicate function

Fixes: #821

Resolves #821.

Description

What is the purpose of this pull request?
Add a utility to test whether some own properties of a provided object satisfies a predicate function

This pull request:

  • The function implementation works by iterating over the “own” properties of an object and applying a predicate function to each property.

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

…utils

Add a utility to test whether some own properties of a provided object satisfies a predicate function

Fixes: stdlib-js#821
Copy link
Member

@Pranavchiku Pranavchiku left a comment

Choose a reason for hiding this comment

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

Good progress, requested a few changes, once done this PR can be reviewed.

lib/node_modules/@stdlib/utils/some-own-by/README.md Outdated Show resolved Hide resolved
lib/node_modules/@stdlib/utils/some-own-by/README.md Outdated Show resolved Hide resolved
lib/node_modules/@stdlib/utils/some-own-by/README.md Outdated Show resolved Hide resolved
lib/node_modules/@stdlib/utils/some-own-by/README.md Outdated Show resolved Hide resolved
lib/node_modules/@stdlib/utils/some-own-by/README.md Outdated Show resolved Hide resolved
lib/node_modules/@stdlib/utils/some-own-by/docs/repl.txt Outdated Show resolved Hide resolved
lib/node_modules/@stdlib/utils/some-own-by/package.json Outdated Show resolved Hide resolved
@Pranavchiku Pranavchiku added the Needs Changes Pull request which needs changes before being merged. label Mar 2, 2024
…utils (Revision 1)

Add a utility to test whether some own properties of a provided object satisfies a predicate function

Signed-off-by: Pranavchiku [email protected]
…utils (Revision 1)

Add a utility to test whether some own properties of a provided object satisfies a predicate function

Signed-off-by: Pranavchiku [email protected]
@kgryte kgryte changed the title feat(@stdlib/utils): if applied, this commit will add 'someOwnBy' feat: add utils/some-own-by Mar 2, 2024
@kgryte kgryte added Feature Issue or pull request for adding a new feature. Utilities Issue or pull request concerning general utilities. labels Mar 2, 2024
@performant23
Copy link
Contributor Author

Hi all, I have applied changes from code review but when I'm trying to push the code, I'm getting this:

git push origin feature/add-@stdlib/utils/some-own-by
Checking if remote branch exists...
Remote branch exists.
Checking for commits to push...
Found commits to push.
Checking licenses...
No dependency licensing issues detected.
Running JavaScript example files...

Running example: D:/stdlib/lib/node_modules/@stdlib/utils/some-own-by/examples/index.js
false
Running README JavaScript examples...

Running Markdown JavaScript examples: D:/stdlib/lib/node_modules/@stdlib/utils/some-own-by/README.md
lib\node_modules\@stdlib\utils\some-own-by\README.md
  1:1  error  Error: unexpected error. Encountered an error when executing code block. File: `lib\node_modules\@stdlib\utils\some-own-by\README.md`. Message: `Invalid Unicode escape sequence`.
    at next (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:259:13)
    at done (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:318:4)
    at next (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:268:12)
    at done (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:318:4)
    at next (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:155:12)
    at done (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:318:4)
    at next (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:155:12)
    at done (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:318:4)
    at next (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:155:12)
    at done (D:\stdlib\lib\node_modules\@stdlib\_tools\remark\plugins\remark-run-javascript-examples\lib\runner.js:318:4)

× 1 error
make: *** [D:/stdlib/tools/make/lib/examples/markdown_javascript.mk:89: markdown-examples-javascript-files] Error 1

Encountered an error when running README JavaScript examples.

error: failed to push some refs to 'https://github.com/performant23/stdlib.git'

I checked the examples included as markdown in README but I'm not sure what's causing the error (While it says invalid unicode escape sequence, the marked down examples don't use unicode esape sequences and checked the paths too). So, I'd be really grateful if you could guide me on solving this! Thank you so much!

README.md

performant23 and others added 6 commits March 2, 2024 16:52
Add a utility to test whether some own properties of a provided object satisfies a predicate function

Signed-off-by: Pranavchiku [email protected]
Add a utility to test whether some own properties of a provided object satisfies a predicate function

Signed-off-by: Pranavchiku [email protected]
Add a utility to test whether some own properties of a provided object satisfies a predicate function

Signed-off-by: Pranavchiku [email protected]
…utils (Revision 2)

Apply changes from code review

Signed-off-by: Pranavchiku [email protected]
…utils (Revision 3)

Apply changes from code review (Except README.md)

Signed-off-by: Pranavchiku [email protected]
Co-authored-by: Pranav <[email protected]>
Signed-off-by: Rutam <[email protected]>
@performant23
Copy link
Contributor Author

Thank you so much for the review! I have made the required changes. Please do let me know if there are any additional changes needed!

@Planeshifter
Copy link
Member

Planeshifter commented Mar 8, 2024

@performant23 Thanks; looked good! Will merge once CI passes.

(Ignore the suggestions and edits; I changed the iteration to directly loop over the object's keys without usage of Object.keys but broke stuff in the process that I had to fix...)

@Planeshifter Planeshifter merged commit 80fdd70 into stdlib-js:develop Mar 8, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature. Needs Changes Pull request which needs changes before being merged. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Add @stdlib/utils/some-own-by
4 participants