feat: add string/base/concat #8544
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Resolves #{{TODO: add issue number}}.
Description
This pull request: adds the
@stdlib/string/base/concatpackage to concatenate two strings with fixed arity.The package wraps
String.prototype.concatto provide a fixed-arity function that takes exactly two string arguments, unlike the native method which accepts an arbitrary number of arguments.Related Issues
This pull request has the following related issues:
[RFC]: add
string/base/concat#8520#{{TODO: add related issue number}}
Questions
No.
Other
Implementation Details
lib/node_modules/@stdlib/string/base/concat/concat(str1, str2)- fixed arity (exactly 2 arguments)String.prototype.concatusingstr1.concat(str2)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
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers