docs(lorem): document the fail default strategy for word#3944
Conversation
✅ Deploy Preview for fakerjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3944 +/- ##
=======================================
Coverage 98.84% 98.84%
=======================================
Files 923 923
Lines 3216 3216
Branches 583 583
=======================================
Hits 3179 3179
Misses 33 33
Partials 4 4
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Nicely spottled.
AFAICT the implementation was changed as part of a major change.
While not exlicitly in the breaking changes list, it has been like this for the entirety of v10, so IMO we should change the jsdocs. Not the implementation.
I consider the current implementation to be correct.
fcdb2a5 to
615800b
Compare
|
Makes sense — reverted the implementation change and fixed the |
615800b to
409f25d
Compare
faker.lorem.worddocuments anany-lengthdefault resolution strategy, returning a word of any length when none matches the requested length. The change that switched the shared word length filter to thefailstrategy (#3560) targeted only the word module, butlorem.wordforwards its options to that filter without a strategy, so it started throwingNo words found that match the given length.The upgrade guide only listsfaker.word.*methods for this breaking change, andlorem.word's JSDoc still documentsany-length.This passes
any-lengthas the default while still letting a caller-provided strategy override it, restoring the documented behavior. Adds a regression test.