Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/support/seeded-runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type MethodOf<TObjectType, TSignature extends Callable = Callable> = {
type FakerModule = {
[Key in keyof Faker]: Faker[Key] extends Callable | string | number | number[]
? never
: Key extends 'definitions' | 'locales'
: Key extends 'definitions' | 'rawDefinitions' | 'fakerCore'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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];

Copy link
Copy Markdown
Member Author

@ST-DDT ST-DDT May 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detect invalidly banned/non-existing keys

exactly

? never
: Key;
}[keyof Faker];
Expand Down
Loading