-
-
Notifications
You must be signed in to change notification settings - Fork 805
feat: add string/base/for-each-right
#1369
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 string/base/for-each-right
#1369
Conversation
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. 🏃 💨
string/base/for-each-right
lib/node_modules/@stdlib/string/base/for-each-right/benchmark/benchmark.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/docs/types/index.d.ts
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/docs/types/test.ts
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/examples/index.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/lib/index.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/test/test.js
Outdated
Show resolved
Hide resolved
Hi @Jaysukh-409 |
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.
Looks great, thank you @AhmedKhaled590 for working on this package (and to @Jaysukh-409 for reviewing!) We can merge after CI has cleared.
lib/node_modules/@stdlib/string/base/for-each-right/docs/repl.txt
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/docs/types/index.d.ts
Outdated
Show resolved
Hide resolved
…/index.d.ts Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
* | ||
* forEach( 'Hello, World!', log ); | ||
*/ | ||
declare function forEachRight( str: string, clbk: Callback, thisArg?: any ): string; |
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.
@Planeshifter We can improve the type for thisArg
, correct? That will impact the callbacks above.
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.
@kgryte Yes, specifically making use of ThisParameterType
to extract the type of the 'this' parameter of the callback function type, and then using generics for the forEachRight
function that will be passed to the this
parameter of the callbacks. But that is currently not done in any of the string/base
packages and maybe we should address it in a follow-up PR / issue?
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.
That is fine. Would you mind creating an issue for this with a link to some sample code where we do use ThisParameterType
? This could be a good first issue for contributors to work on.
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.
@kgryte Will do!
lib/node_modules/@stdlib/string/base/for-each-right/lib/index.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/string/base/for-each-right/package.json
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.
A few nits, but overall looking good. Thanks for working on this @AhmedKhaled590.
lib/node_modules/@stdlib/string/base/for-each-right/docs/repl.txt
Outdated
Show resolved
Hide resolved
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Resolves #856
Description
Adding support for invoking a callback for each UTF-16 character of a string, while iterating from right-to-left
This pull request:
@stdlib/string/base/for-each-right
Related Issues
This pull request:
@stdlib/string/for-each-right
#856Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers