feat: add `symbol/to-string-tag`
Resolves #8482
Description
What is the purpose of this pull request?
This pull request implements the RFC proposing the addition of the symbol/to-string-tag package.
The package is modeled after existing symbol utilities in the repository, including:
symbol/has-instancesymbol/iteratorsymbol/async-iteratorsymbol/is-concat-spreadable
The new package exports Symbol.toStringTag when available in the current environment.
Additional implementation details include:
- copying one of the existing symbol packages as a template
- renaming the package directory and files accordingly
- replacing identifiers throughout the package
(e.g.,has-instance→to-string-tag,HasInstanceSymbol→ToStringTagSymbol) - ensuring the copyright year is 2025
- updating descriptions based on MDN documentation for
Symbol.toStringTag - updating examples to reflect the symbol's intended usage
- running tests, benchmarks, and examples to verify correctness
- checking for any copy-paste errors
Related Issues
Does this pull request have any related issues?
This pull request has the following related issues:
- None.
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.
- [x] Read, understood, and followed the contributing guidelines.
AI Assistance
When authoring the changes proposed in this PR, did you use any kind of AI assistance?
- [x] Yes
- [ ] No
If you answered "yes" above, how did you use AI assistance?
- [x] Documentation (including examples)
- [] Research and understanding
- [ ] Code generation
- [ ] Test/benchmark generation
Disclosure
This PR includes descriptive text drafted with the assistance of ChatGPT to ensure that the RFC details and PR documentation are clear and complete. All code changes were written and validated manually.
@stdlib-js/reviewers
Coverage Report
| Package | Statements | Branches | Functions | Lines |
|---|---|---|---|---|
| symbol/to-string-tag | $\color{green}99/99$ $color{green}+100.00%$ |
$\color{red}2/3$ $color{green}+66.67%$ |
$\color{green}0/0$ $color{green}+100.00%$ |
$\color{green}99/99$ $color{green}+100.00%$ |
The above coverage report was generated for the changes in this PR.
@kgryte i have fixed all copy-paste errors pls review it whenever you get time .