chore: fix FakerModule test type#3866
Open
ST-DDT wants to merge 2 commits into
Open
Conversation
✅ Deploy Preview for fakerjs ready!
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 #3866 +/- ##
==========================================
- Coverage 98.92% 98.86% -0.07%
==========================================
Files 908 908
Lines 3159 3159
Branches 581 581
==========================================
- Hits 3125 3123 -2
- Misses 30 32 +2
Partials 4 4 🚀 New features to boost your workflow:
|
Shinigami92
reviewed
May 30, 2026
| [Key in keyof Faker]: Faker[Key] extends Callable | string | number | number[] | ||
| ? never | ||
| : Key extends 'definitions' | 'locales' | ||
| : Key extends 'definitions' | 'rawDefinitions' | 'fakerCore' |
Member
There was a problem hiding this comment.
suggestion (if-minor): have you considered something like this?
/**
* Identity type whose constraint forces every member to be a real key of `Faker`.
* This makes a stale entry in the {@link FakerModule} exclusion list fail to compile.
*/
type FakerKeys<T extends keyof Faker> = T;
/**
* A type allowing only the names of faker modules.
*/
type FakerModule = {
[Key in keyof Faker]: Faker[Key] extends Callable | string | number | number[]
? never
: Key extends FakerKeys<'definitions' | 'rawDefinitions' | 'fakerCore'>
? never
: Key;
}[keyof Faker];
Member
Author
There was a problem hiding this comment.
What would be the benefit of that?
Do detect invalidly banned/non-existing keys?
Since it does not detect invalidly allowed keys, I'm kind of neutral about this.
@others any preference?
Member
There was a problem hiding this comment.
detect invalidly banned/non-existing keys
exactly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
FakerModuletest type to latest version.