-
-
Notifications
You must be signed in to change notification settings - Fork 804
feat: add array/base/count-same-value-zero
#1384
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 array/base/count-same-value-zero
#1384
Conversation
count the number of elements that are equal to a given value in an array Fixes stdlib-js#1326
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hi there! 👋
And thank you for opening your first pull request! We will review it shortly. 🏃 💨
lib/node_modules/@stdlib/array/base/count-same-value-zero/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/array/base/count-same-value-zero/docs/types/index.d.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this changes are done I think this PR will be ready to merge.
Co-authored-by: Jaysukh Makvana <111515433+Jaysukh-409@users.noreply.github.com> Signed-off-by: AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com>
array/base/count-same-value-zero
@AgPriyanshu18 This PR is missing a |
* @example | ||
* var x = [ 0, 0, 1, 0, 1 ]; | ||
* | ||
* var n = countSameValueZero( x, 1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before using countSameValueZero
you have to import it. You can do it as shown below.
var countSameValueZero = require( '@stdlib/array/base/is-same-value-zero' );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a commented-out example that's why I didn't import the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While linting we also check the example code syntax also and that's why it should be correct.
Suggested changes done Fixes stdlib-js#1328
10d95dd
to
c080fc3
Compare
@kgryte I have added the file and have made suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this merged; will do so after CI has passed. Thanks for your contribution!
lib/node_modules/@stdlib/array/base/count-same-value-zero/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/array/base/count-same-value-zero/lib/main.js
Outdated
Show resolved
Hide resolved
…main.js Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
…main.js Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter Why did this one get merged when CI was failing? |
@kgryte don't recall exactly why i didn’t notice, but I fixed the require path in a subsequent commit to make sure tests pass. Bug was only due to require path in example code that got inserted during review process. One downside of requiring signed commits is that one regularly has to bypass branch protection rules and there is not an easy visual cue without reading it fully of whether it's blocked to CI failures or just due to commits not being signed. |
Resolves #1326.
Description
This pull request:
Related Issues
This pull request:
@stdlib/array/base/count-same-value-zero
#1326Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers