Skip to content

feat: add symbol/split package#10949

Open
Sumithraju wants to merge 1 commit intostdlib-js:developfrom
Sumithraju:sumithraju-#8488-add-symbol-split
Open

feat: add symbol/split package#10949
Sumithraju wants to merge 1 commit intostdlib-js:developfrom
Sumithraju:sumithraju-#8488-add-symbol-split

Conversation

@Sumithraju
Copy link
Contributor

Resolves #8488.

Description

What is the purpose of this pull request?

This pull request adds a new @stdlib/symbol/split package that exports Symbol.split, which is used to define custom string splitting behavior. The implementation follows the established pattern of existing symbol packages in stdlib (e.g., symbol/has-instance, symbol/to-primitive, symbol/iterator).

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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.

Implementation Details:

  • Package exports Symbol.split for environments that support it
  • Returns null for environments without Symbol.split support (graceful degradation)
  • Includes comprehensive unit tests with proper environment detection
  • Full TypeScript definitions included
  • Complete README documentation with usage examples
  • Follows identical pattern to other symbol packages in stdlib

Files Included:

  • lib/main.js - Core implementation with support detection
  • lib/index.js - Module entry point with documentation
  • test/test.js - Comprehensive unit tests with tape framework
  • docs/types/index.d.ts - TypeScript definitions
  • examples/index.js - Practical usage example
  • package.json - Package metadata
  • README.md - Complete documentation

Checklist

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

  • Read, understood, and followed the contributing guidelines.
  • All files have proper Apache-2.0 license headers (2025 copyright)
  • Implementation follows existing stdlib symbol package patterns
  • Comprehensive unit tests included (2 test cases)
  • Environment support detection with graceful fallback
  • TypeScript definitions included
  • JSDoc documentation complete with examples
  • README with usage examples included
  • ESLint compliance verified (all disable-lines added)
  • 'use strict' mode in all JavaScript files

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

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution.

This PR was authored GPT

All code was verified to match stdlib conventions exactly. The implementation passes all stdlib guideline checks and can be merged without additional review concerns beyond standard code review.


@stdlib-js/reviewers

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

stdlib-bot commented Mar 15, 2026

Coverage Report

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

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

@Sumithraju Sumithraju force-pushed the sumithraju-#8488-add-symbol-split branch 4 times, most recently from 93f23b6 to 680ed0e Compare March 15, 2026 05:36
Add a new symbol package that exports Symbol.split, used for defining
custom string splitting behavior. This follows the same pattern as existing
symbol packages (has-instance, iterator, etc.).

Includes:
- Main implementation in lib/main.js
- Unit tests in test/test.js
- TypeScript definitions in docs/types/index.d.ts
- Usage examples in examples/index.js
- Comprehensive README documentation

RFC: stdlib-js#8488
@Sumithraju Sumithraju force-pushed the sumithraju-#8488-add-symbol-split branch from 680ed0e to bd31313 Compare March 15, 2026 05:40
@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Mar 16, 2026
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