Skip to content

Conversation

@DivyanshuVortex
Copy link
Contributor

@DivyanshuVortex DivyanshuVortex commented Nov 14, 2025

Resolves #8479

Description

This pull request implements the RFC for introducing the package assert/has-split-symbol-support.

The implementation follows the structure and conventions of similar existing packages:

  • assert/has-iterator-symbol-support
  • assert/has-is-concat-spreadable-symbol-support
  • assert/has-has-instance-symbol-support

Summary of changes

  • Added a new assertion utility to detect support for Symbol.split.
  • Copied the base implementation from assert/has-iterator-symbol-support.
  • Updated all identifiers from iteratorsplit.
  • Implemented correct detection logic for Symbol.split.
  • Added tests, examples, and benchmarks, modeled after existing stdlib packages.
  • Verified all tests and benchmarks pass locally.

No additional functional differences exist beyond checking for Symbol.split.


Related Issues


Questions

No questions for reviewers at this time.


Other

No additional notes or screenshots required.
Implementation follows stdlib package conventions.


Checklist


AI Assistance

Did you use AI assistance?

  • Yes
  • No

If yes, how?

  • [] Code generation (implementation guidance)
  • [] Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

I consulted GPT for guidance and clarity on stdlib patterns while preparing this PR.
All final implementation code and decisions were authored manually.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Nov 14, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Nov 14, 2025

Coverage Report

Package Statements Branches Functions Lines
symbol/replace $\color{green}110/110$
$color{green}+100.00%$
$\color{red}2/3$
$color{green}+66.67%$
$\color{green}0/0$
$color{green}+100.00%$
$\color{green}110/110$
$color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

@DivyanshuVortex DivyanshuVortex changed the title add symbol/replace feat : add symbol/replace Nov 14, 2025
@DivyanshuVortex DivyanshuVortex changed the title feat : add symbol/replace feat: add symbol/replace Nov 14, 2025
@DivyanshuVortex
Copy link
Contributor Author

“Hey @kgryte, I went through the development guide, but I’m still unable to resolve the body issue in the test lint rule. Could you please take a look?”

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Nov 15, 2025

// TESTS //

tape( 'main export is a symbol in supporting environments or null otherwise', testMain );
Copy link
Member

Choose a reason for hiding this comment

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

@DivyanshuVortex This is not how we write tests. Please follow the style that we use throughout the project. That you deviated from that style is why CI is currently failing.

Comment on lines +24 to +26
* This symbol specifies the method that replaces matched substrings and is used
* by `String.prototype.replace()` to delegate replacement behavior to an object.
*
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* This symbol specifies the method that replaces matched substrings and is used
* by `String.prototype.replace()` to delegate replacement behavior to an object.
*

Comment on lines +28 to +31
* - This well-known symbol specifies the method that replaces matched substrings.
* It is used by `String.prototype.replace()` to delegate replacement behavior.
* - The symbol is only supported in ES6/ES2015+ environments. In non-supporting
* environments, the exported value is `null`.
Copy link
Member

Choose a reason for hiding this comment

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

We do not line wrap descriptions.


## Usage

```javascript
Copy link
Member

Choose a reason for hiding this comment

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

This is not how our READMEs are structured. Please follow that structure exactly. It is not clear why you removed the typical import statement, the typical heading, etc. The original RFC suggested simply copy-pasting and then tweaking. Here, you decided to deviate from project conventions.

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.

Left initial comments.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Nov 18, 2025
@kgryte
Copy link
Member

kgryte commented Nov 18, 2025

Ref: a68d5d9

@kgryte kgryte added the autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. label Nov 18, 2025
@stdlib-bot
Copy link
Contributor

Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit.

Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.

@stdlib-bot stdlib-bot closed this Nov 18, 2025
@DivyanshuVortex DivyanshuVortex deleted the feat/symbol-replace branch November 18, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. Good First PR A pull request resolving a Good First Issue. Needs Changes Pull request which needs changes before being merged. Potential Duplicate There might be another pull request resolving the same issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add symbol/replace

3 participants