Skip to content

Conversation

@Muzaffar0076
Copy link

Add package to concatenate two strings with fixed arity.

This package wraps String.prototype.concat to provide a fixed-arity function that takes exactly two string arguments, unlike the native method which accepts an arbitrary number of arguments.

Closes #8520


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: passed
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: passed
  • task: lint_license_headers status: passed ---

Resolves #{{TODO: add issue number}}.

Description

What is the purpose of this pull request?

This pull request: adds the @stdlib/string/base/concat package to concatenate two strings with fixed arity.

The package wraps String.prototype.concat to provide a fixed-arity function that takes exactly two string arguments, unlike the native method which accepts an arbitrary number of arguments.

  • {{TODO: add description describing what this pull request does}}

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 location: lib/node_modules/@stdlib/string/base/concat/
  • Function signature: concat(str1, str2) - fixed arity (exactly 2 arguments)
  • Implementation: Wraps String.prototype.concat using str1.concat(str2)
  • All tests pass: 10/10 unit tests
  • Examples run successfully
  • Benchmarks execute correctly
  • TypeScript declarations included
  • Complete documentation provided

Testing

All tests, examples, and benchmarks have been verified:
ash
✓ make TESTS_FILTER=".string/base/concat." test # 10/10 passing
✓ make EXAMPLES_FILTER=".string/base/concat." examples # All successful
✓ make BENCHMARKS_FILTER=".string/base/concat." benchmark # All passing## Checklist

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

  • Read, understood, and followed the contributing guidelines.
  • All tests pass
  • Examples run successfully
  • Benchmarks execute correctly
  • Documentation is complete
  • Copyright year is 2025
  • No linting errors

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. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

Add package to concatenate two strings with fixed arity.

This package wraps String.prototype.concat to provide a fixed-arity
function that takes exactly two string arguments, unlike the native
method which accepts an arbitrary number of arguments.

Closes stdlib-js#8520

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@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 16, 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

Coverage Report

Package Statements Branches Functions Lines
string/base/concat $\color{green}81/81$
$color{green}+100.00%$
$\color{green}3/3$
$color{green}+100.00%$
$\color{green}1/1$
$color{green}+100.00%$
$\color{green}81/81$
$color{green}+100.00%$

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

@Muzaffar0076
Copy link
Author

Hi! I've completed the implementation for issue #8520 (adding string/base/concat).

This is my first contribution to stdlib, and I'd appreciate a mentor review to ensure everything follows project conventions. All tests, examples, and benchmarks pass successfully.

@kgryte - Could you please review this PR?

Thank you!

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Nov 16, 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 string/base/concat

2 participants