Skip to content

feat: add minCharacters option to randomParagraph#39

Merged
ogroppo merged 2 commits intocodeledge:mainfrom
ssuverev:feat/random-paragraph-min-characters
Apr 15, 2026
Merged

feat: add minCharacters option to randomParagraph#39
ogroppo merged 2 commits intocodeledge:mainfrom
ssuverev:feat/random-paragraph-min-characters

Conversation

@ssuverev
Copy link
Copy Markdown
Contributor

Summary

  • Adds optional minCharacters parameter to randomParagraph()
  • When set, words are added beyond maxWords until the joined string reaches the minimum character threshold
  • Result is still capped by maxCharacters (truncation wins)
  • Default behavior (minCharacters: undefined) is fully backward-compatible

Test plan

  • randomParagraph({ minCharacters: 100 }) — always >= 100 chars
  • randomParagraph({ minCharacters: 150, maxCharacters: 200 }) — result 150-200 chars
  • randomParagraph({ minCharacters: 300, maxCharacters: 200 }) — caps at 200
  • randomParagraph() — default behavior unchanged

Adds an optional minCharacters parameter that ensures the generated
paragraph meets a minimum character length by adding words beyond
maxWords. The result is still capped by maxCharacters (truncation wins).
@ogroppo
Copy link
Copy Markdown
Contributor

ogroppo commented Apr 14, 2026

thank you please run pnpm release then I'll merge

@ssuverev
Copy link
Copy Markdown
Contributor Author

thank you please run pnpm release then I'll merge

Done, sire

@ogroppo ogroppo merged commit 345b5d9 into codeledge:main Apr 15, 2026
@ogroppo
Copy link
Copy Markdown
Contributor

ogroppo commented Apr 15, 2026

Successfully published deverything@5.1.0

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.

2 participants