Skip to content

Conversation

@ShraddheyaS
Copy link
Contributor

@ShraddheyaS ShraddheyaS commented Sep 8, 2020

Resolves #357.

Checklist

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

  • Read, understood, and followed the contributing guidelines, including the relevant style guides.
  • Read and understand the Code of Conduct.
  • Read and understood the licensing terms.
  • Searched for existing issues and pull requests before submitting this pull request.
  • Filed an issue (or an issue already existed) prior to submitting this pull request.
  • Rebased onto latest develop.
  • Submitted against develop branch.

Description

What is the purpose of this pull request?

This pull request:

  • Adds support for getting next extended grapheme cluster break in a string after a specified position.

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.


@stdlib-js/reviewers

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.

@ShraddheyaS Overall looks good, with some minor comments, questions, and requested changes. Once we resolve these, this should be ready for merge!

@ShraddheyaS ShraddheyaS requested a review from kgryte September 24, 2020 11:27
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.

@ShraddheyaS Wow! Really great work! Will touch up a couple of minor things on my end. Thanks for this contribution!


- If `string` is an empty string, the function returns `-1` irrespective of `fromIndex`.
- If there is no extended grapheme cluster break after `fromIndex`, the function returns `-1`.
- Note that `fromIndex` does **not** refer to a visual character position, but to an index in the ordered sequence of [UTF-16][utf-16] code units.
Copy link
Member

Choose a reason for hiding this comment

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

Aside: we may want to consider, if we don't already have such functionality, one or more string utilities (as separate packages) for indexing, and maybe iterating over, visual characters. I believe such utilities would build on the current work.

@kgryte kgryte merged commit 1ee75fc into stdlib-js:develop Sep 30, 2020
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 support for getting next extended grapheme cluster break Algorithm to remove the first string character is not Unicode aware

2 participants