Skip to content

feat(string): add strStartsWithAny, strEndsWithAny, strWrap, strUnwrap, strNormalizeNewlines#543

Merged
nev21 merged 1 commit intomainfrom
nev21/strFuncs
Apr 2, 2026
Merged

feat(string): add strStartsWithAny, strEndsWithAny, strWrap, strUnwrap, strNormalizeNewlines#543
nev21 merged 1 commit intomainfrom
nev21/strFuncs

Conversation

@nev21
Copy link
Copy Markdown
Contributor

@nev21 nev21 commented Apr 2, 2026

Add new string utility functions:

  • strStartsWithAny / strEndsWithAny: check whether a string starts or ends with any value in an array-like list of search values
  • strWrap / strUnwrap: wrap a string with a prefix/suffix pair, or remove a single wrapping pair when present
  • strNormalizeNewlines: normalize mixed newline sequences (\r\n, \r) to a canonical form (\n by default)

…p, strNormalizeNewlines

Add five new string utility functions:
- strStartsWithAny / strEndsWithAny: check whether a string starts or
  ends with any value in an array-like list of search values
- strWrap / strUnwrap: wrap a string with a prefix/suffix pair, or
  remove a single wrapping pair when present
- strNormalizeNewlines: normalize mixed newline sequences (\r\n, \r)
  to a canonical form (\n by default)
@nev21 nev21 added this to the 0.14.0 milestone Apr 2, 2026
@nev21 nev21 requested review from a team as code owners April 2, 2026 04:15
Copilot AI review requested due to automatic review settings April 2, 2026 04:15
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.46%. Comparing base (e79a0e3) to head (49d21b1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #543   +/-   ##
=======================================
  Coverage   99.45%   99.46%           
=======================================
  Files         142      145    +3     
  Lines        4196     4271   +75     
  Branches      903      915   +12     
=======================================
+ Hits         4173     4248   +75     
  Misses         23       23           
Files with missing lines Coverage Δ
lib/src/helpers/base.ts 100.00% <100.00%> (ø)
lib/src/string/normalize_newlines.ts 100.00% <100.00%> (ø)
lib/src/string/starts_ends_with_any.ts 100.00% <100.00%> (ø)
lib/src/string/wrap.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds several new string helpers (starts/ends-with-any, wrap/unwrap, newline normalization) and updates docs/size budgets to accommodate the new surface area.

Changes:

  • Added new string utilities: strStartsWithAny, strEndsWithAny, strWrap, strUnwrap, strNormalizeNewlines.
  • Added common tests covering the new helpers.
  • Updated bundle size thresholds and removed completed items from the feature backlog.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/src/string/wrap.ts Introduces strWrap / strUnwrap helpers.
lib/src/string/starts_ends_with_any.ts Introduces strStartsWithAny / strEndsWithAny.
lib/src/string/normalize_newlines.ts Introduces strNormalizeNewlines.
lib/src/index.ts Re-exports new helpers; adjusts existing exports.
lib/src/helpers/base.ts Updates isStrictNullOrUndefined and isDefined typing/docs.
lib/test/src/common/string/wrap.test.ts Adds tests for wrap/unwrap behavior.
lib/test/src/common/string/starts_ends_with_any.test.ts Adds tests for starts/ends-with-any behavior.
lib/test/src/common/string/normalize_newlines.test.ts Adds tests for newline normalization behavior.
lib/test/bundle-size-check.js Updates bundle-size thresholds used by tests.
.size-limit.json Updates size-limit thresholds for dist outputs.
docs/feature-backlog.md Removes the now-implemented string utilities backlog section.

Copy link
Copy Markdown
Contributor

@nevware21-bot nevware21-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

@nev21 nev21 merged commit 1ac30dc into main Apr 2, 2026
14 checks passed
@nev21 nev21 deleted the nev21/strFuncs branch April 2, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants