Skip to content

feat: add P.string.notEmpty() matcher (trim-aware)#348

Open
joe2k01 wants to merge 3 commits intogvergnaud:mainfrom
joe2k01:feature/p-string-not-empty
Open

feat: add P.string.notEmpty() matcher (trim-aware)#348
joe2k01 wants to merge 3 commits intogvergnaud:mainfrom
joe2k01:feature/p-string-not-empty

Conversation

@joe2k01
Copy link
Copy Markdown

@joe2k01 joe2k01 commented Mar 29, 2026

Adds P.string.notEmpty() to match strings with value.trim().length > 0, so empty and whitespace-only strings are excluded (unlike P.string.minLength(1)).

Changes

  • Runtime guard and stringChainable method in src/patterns.ts
  • StringChainable typing + JSDoc in src/types/Pattern.ts
  • Tests in tests/strings.test.ts
  • README section under P.string predicates

Verification

  • npm test passes
  • npm run build passes

joe2k01 added 3 commits March 29, 2026 18:56
Match strings with trim().length > 0; document distinction from minLength(1).

Made-with: Cursor
Chaining is covered in chainable.test.ts; strings.test.ts mirrors other predicates.

Made-with: Cursor
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.

1 participant