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 string/base/replace-before-last #1364

Merged
merged 16 commits into from
Feb 27, 2024
Merged

feat: add string/base/replace-before-last #1364

merged 16 commits into from
Feb 27, 2024

Conversation

AuenKr
Copy link
Contributor

@AuenKr AuenKr commented Feb 24, 2024

Resolves #813 .

Description

What is the purpose of this pull request?

This pull request:

  • adding a utility to replace the substring before the last occurrence of a specified search string.

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

@kgryte kgryte changed the title feat: add @stdlib/string/base/replace-before-last feat: add string/base/replace-before-last Feb 24, 2024
@kgryte kgryte added Feature Issue or pull request for adding a new feature. Utilities Issue or pull request concerning general utilities. Needs Review A pull request which needs code review. labels Feb 24, 2024
@kgryte kgryte added the Needs Changes Pull request which needs changes before being merged. label Feb 24, 2024
@kgryte
Copy link
Member

kgryte commented Feb 25, 2024

@AuenKr Similar to #1363, would you mind updating to support a fromIndex?

@AuenKr
Copy link
Contributor Author

AuenKr commented Feb 25, 2024

@AuenKr Similar to #1363, would you mind updating to support a fromIndex?

Working on this

@AuenKr
Copy link
Contributor Author

AuenKr commented Feb 25, 2024

@kgryte, Can u reopen the [RFC]: Add @stdlib/string/base/replace-before #811,
So I can add fromIndex arguement in it?

@kgryte
Copy link
Member

kgryte commented Feb 25, 2024

@AuenKr I propose you create a new issue proposing the changes you'd like to make, and then you can work against that.

Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Copy link
Member

@kgryte kgryte 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 working on this, @AuenKr. I left a couple comments, mainly around how we should handle the case where fromIndex exceeds the last index.

Signed-off-by: Athan <kgryte@gmail.com>
@AuenKr
Copy link
Contributor Author

AuenKr commented Feb 27, 2024

@kgryte applied all changes of suggestions

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.

Let's land this one as well; will merge once CI has cleared. Thanks!

…ndex.js

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
…types/index.d.ts

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter Planeshifter merged commit 272f91b into stdlib-js:develop Feb 27, 2024
7 checks passed
@AuenKr AuenKr deleted the feature/replace-before-last branch February 27, 2024 16:57
@Planeshifter Planeshifter removed the Needs Review A pull request which needs code review. label Mar 26, 2024
kgryte added a commit that referenced this pull request Apr 6, 2024
BREAKING CHANGE: resolve negative indices relative to last index

In order to preserve prior behavior, users should insert a manual
check before calling this API.

Ref: #1364
Ref: 272f91b
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/string/base/replace-before-last
4 participants