Skip to content

Conversation

@WillyEverGreen
Copy link
Contributor

@WillyEverGreen WillyEverGreen commented Dec 13, 2025

Resolves #8488.

Description

This pull request adds the @stdlib/symbol/split package, which provides access to
the well-known Symbol.split symbol in environments that support it and null
otherwise.

The package follows established stdlib conventions and includes documentation,
examples, tests, REPL help text, TypeScript definitions, and namespace integration.

Related Issues

Questions

No.

Other

Implementation Notes

The package structure follows existing conventions established by similar stdlib
packages, including:

  • @stdlib/symbol/replace
  • @stdlib/symbol/has-instance
  • @stdlib/symbol/is-concat-spreadable

Files Added

File Description
lib/node_modules/@stdlib/symbol/split/lib/main.js Main implementation exporting Symbol.split or null
lib/node_modules/@stdlib/symbol/split/lib/index.js Module entry point
lib/node_modules/@stdlib/symbol/split/test/test.js Unit tests
lib/node_modules/@stdlib/symbol/split/examples/index.js Usage examples
lib/node_modules/@stdlib/symbol/split/README.md Package documentation
lib/node_modules/@stdlib/symbol/split/package.json Package metadata
lib/node_modules/@stdlib/symbol/split/docs/repl.txt REPL help text
lib/node_modules/@stdlib/symbol/split/docs/types/index.d.ts TypeScript definitions
lib/node_modules/@stdlib/symbol/split/docs/types/test.ts TypeScript tests

Files Modified

File Description
lib/node_modules/@stdlib/symbol/lib/index.js Added SplitSymbol to the symbol namespace

Test Results

All tests pass.

Checklist

AI Assistance

  • Yes
  • No

Disclosure:
AI assistance was used to generate the initial implementation, tests, and
documentation based on existing stdlib symbol packages. I reviewed the generated
code, verified its behavior locally, ensured it follows project conventions, and
take responsibility for this contribution.

@stdlib-js/reviewers

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@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 Dec 13, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 13, 2025

Coverage Report

Package Statements Branches Functions Lines
symbol $\color{green}929/929$
$\color{green}+0.00%$
$\color{red}17/25$
$\color{green}+0.00%$
$\color{green}0/0$
$\color{green}+0.00%$
$\color{green}929/929$
$\color{green}+0.00%$
symbol/split $\color{green}92/92$
$\color{green}+0.00%$
$\color{red}2/3$
$\color{green}+0.00%$
$\color{green}0/0$
$\color{green}+0.00%$
$\color{green}92/92$
$\color{green}+0.00%$

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

This commit adds the `@stdlib/symbol/split` package which exports
`Symbol.split` if the environment supports it, otherwise `null`.

The `Symbol.split` symbol specifies a method that splits a string at
the indices that match a regular expression. When calling
`String.prototype.split` and the separator argument is an object
with a `[Symbol.split]()` method, this method is called with the
target string and limit as arguments.

The package structure follows the existing convention established
by similar packages such as `symbol/replace`, `symbol/has-instance`,
and `symbol/is-concat-spreadable`.

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

Labels

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/split

2 participants