Skip to content

Change default word filtering strategy to fail #3263

@ST-DDT

Description

@ST-DDT

it('returns the word list if no words match the length', () => {
const result = filterWordListByLength({
wordList,
length,
});
// TODO @ST-DDT 2022-10-02: This should throw an error in the next major version.
expect(result).toEqual(wordList);
});

IMO if the user specifies a specific length for their words, then by default it should fail if the request cannot be fulfilled.
If the user wants a different behavior, then they can still define an explicit error handling strategy.

Found while looking at: #3261

Metadata

Metadata

Labels

breaking changeCannot be merged when next version is not a major releasec: refactorPR that affects the runtime behavior, but doesn't add new features or fixes bugsm: wordSomething is referring to the word modulep: 1-normalNothing urgent

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions