Skip to content

Conversation

@aryan7071
Copy link

@aryan7071 aryan7071 commented Nov 14, 2025

Resolves #8479

Description

This pull request implements the RFC to add support for two new packages:

1. @stdlib/symbol/replace

  • Exports Symbol.replace when supported by the environment.
  • Exports undefined in environments without native Symbol.replace support.
  • Includes documentation, examples, benchmarks, TypeScript types, and tests.
  • Mirrors the structure and conventions used by existing symbol-related packages such as:
    • symbol/iterator
    • symbol/async-iterator
    • symbol/has-instance

2. @stdlib/assert/has-replace-symbol-support

  • Provides feature detection for native Symbol.replace.
  • Exports a boolean indicating support.
  • Includes:
    • Library implementation
    • Test suite
    • Benchmarks
    • CLI (has-replace-symbol-support)
    • Examples
    • TypeScript definitions and TS tests
    • README and usage docs

This PR follows the package-creation checklist outlined in the RFC:

  • Copied from a similar existing package
  • Renamed package and variable names
  • Updated copyright years to 2025
  • Updated documentation and examples to reflect Symbol.replace
  • Verified the implementation through local testing

Related Issues


Questions

No.


Other

No additional information.


Checklist

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was authored and implemented by me. I used ChatGPT to help with formatting, code and test scaffolding, documentation consistency, and to confirm that the package layout and conventions match other stdlib packages. All final code, edits, and decisions were reviewed and approved by me before submission.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. 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

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Gitter channel to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Nov 14, 2025

Coverage Report

Package Statements Branches Functions Lines
assert/has-replace-symbol-support $\color{green}91/91$
$color{green}+100.00%$
$\color{green}6/6$
$color{green}+100.00%$
$\color{green}1/1$
$color{green}+100.00%$
$\color{green}91/91$
$color{green}+100.00%$
symbol/replace $\color{green}90/90$
$color{green}+100.00%$
$\color{red}2/3$
$color{green}+66.67%$
$\color{green}0/0$
$color{green}+100.00%$
$\color{green}90/90$
$color{green}+100.00%$

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

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review. 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

2 participants