Skip to content

Commit cc46a0c

Browse files
authored
chore: remove obsolete definition key constants (#910)
1 parent 385c03a commit cc46a0c

20 files changed

Lines changed: 6 additions & 290 deletions

src/definitions/address.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to addresses.
53
*/
@@ -99,36 +97,3 @@ export interface AddressDefinitions {
9997
// A list of timezones names.
10098
time_zone: string[];
10199
}
102-
103-
/**
104-
* Internal: A list of all keys for the AddressDefinitions.
105-
*/
106-
export const ADDRESS = allOf<keyof AddressDefinitions>()(
107-
'postcode_by_state',
108-
'postcode',
109-
110-
'city_name',
111-
'city_prefix',
112-
'city_suffix',
113-
114-
'country',
115-
'state',
116-
'state_abbr',
117-
'county',
118-
119-
'direction_abbr',
120-
'direction',
121-
122-
'building_number',
123-
124-
'street_prefix',
125-
'street_suffix',
126-
127-
'street_address',
128-
'secondary_address',
129-
130-
'country_code',
131-
'country_code_alpha_3',
132-
133-
'time_zone'
134-
);

src/definitions/animal.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to animals.
53
*/
@@ -19,23 +17,3 @@ export interface AnimalDefinitions {
1917
snake: string[];
2018
type: string[];
2119
}
22-
23-
/**
24-
* Internal: A list of all keys for the AnimalDefinitions.
25-
*/
26-
export const ANIMAL = allOf<keyof AnimalDefinitions>()(
27-
'dog',
28-
'cat',
29-
'snake',
30-
'bear',
31-
'lion',
32-
'cetacean',
33-
'insect',
34-
'crocodilia',
35-
'cow',
36-
'bird',
37-
'fish',
38-
'rabbit',
39-
'horse',
40-
'type'
41-
);

src/definitions/commerce.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to commerce.
53
*/
@@ -39,13 +37,3 @@ export interface CommerceProductNameDefinitions {
3937
*/
4038
product: string[];
4139
}
42-
43-
/**
44-
* Internal: A list of all keys for the CommerceDefinitions.
45-
*/
46-
export const COMMERCE = allOf<keyof CommerceDefinitions>()(
47-
'color',
48-
'department',
49-
'product_name',
50-
'product_description'
51-
);

src/definitions/company.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to companies.
53
*/
@@ -33,18 +31,3 @@ export interface CompanyDefinitions {
3331
*/
3432
suffix: string[];
3533
}
36-
37-
/**
38-
* Internal: A list of all keys for the CompanyDefinitions.
39-
*/
40-
export const COMPANY = allOf<keyof CompanyDefinitions>()(
41-
'bs_adjective',
42-
'bs_noun',
43-
'bs_verb',
44-
45-
'adjective',
46-
'descriptor',
47-
'noun',
48-
49-
'suffix'
50-
);

src/definitions/database.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to databases.
53
*/
@@ -21,13 +19,3 @@ export interface DatabaseDefinitions {
2119
*/
2220
type: string[];
2321
}
24-
25-
/**
26-
* Internal: A list of all keys for the DatabaseDefinitions.
27-
*/
28-
export const DATABASE = allOf<keyof DatabaseDefinitions>()(
29-
'collation',
30-
'column',
31-
'engine',
32-
'type'
33-
);

src/definitions/date.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to dates.
53
*/
@@ -37,8 +35,3 @@ export interface DateEntryDefinition {
3735
*/
3836
abbr_context?: string[];
3937
}
40-
41-
/**
42-
* Internal: A list of all keys for the DateDefinitions.
43-
*/
44-
export const DATE = allOf<keyof DateDefinitions>()('month', 'weekday');

src/definitions/definitions.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,19 @@
11
import type { AddressDefinitions } from './address';
2-
import { ADDRESS } from './address';
32
import type { AnimalDefinitions } from './animal';
4-
import { ANIMAL } from './animal';
53
import type { CommerceDefinitions } from './commerce';
6-
import { COMMERCE } from './commerce';
74
import type { CompanyDefinitions } from './company';
8-
import { COMPANY } from './company';
95
import type { DatabaseDefinitions } from './database';
10-
import { DATABASE } from './database';
116
import type { DateDefinitions } from './date';
12-
import { DATE } from './date';
137
import type { FinanceDefinitions } from './finance';
14-
import { FINANCE } from './finance';
158
import type { HackerDefinitions } from './hacker';
16-
import { HACKER } from './hacker';
179
import type { InternetDefinitions } from './internet';
18-
import { INTERNET } from './internet';
1910
import type { LoremDefinitions } from './lorem';
20-
import { LOREM } from './lorem';
2111
import type { MusicDefinitions } from './music';
22-
import { MUSIC } from './music';
2312
import type { NameDefinitions } from './name';
24-
import { NAME } from './name';
2513
import type { PhoneNumberDefinitions } from './phone_number';
26-
import { PHONE_NUMBER } from './phone_number';
2714
import type { SystemDefinitions } from './system';
28-
import { SYSTEM } from './system';
2915
import type { VehicleDefinitions } from './vehicle';
30-
import { VEHICLE } from './vehicle';
3116
import type { WordDefinitions } from './word';
32-
import { WORD } from './word';
3317

3418
/**
3519
* The definitions as used by the Faker modules.
@@ -84,29 +68,3 @@ export type DefinitionTypes = {
8468
} & {
8569
readonly [module in keyof Definitions]: Array<keyof Definitions[module]>;
8670
};
87-
88-
/**
89-
* Internal: List off all modules and their properties,
90-
* that needs to have a fallback generated in Faker.loadDefinitions().
91-
*/
92-
export const DEFINITIONS: DefinitionTypes = {
93-
title: 'metadata',
94-
separator: 'metadata',
95-
96-
address: ADDRESS,
97-
animal: ANIMAL,
98-
company: COMPANY,
99-
commerce: COMMERCE,
100-
database: DATABASE,
101-
date: DATE,
102-
finance: FINANCE,
103-
hacker: HACKER,
104-
internet: INTERNET,
105-
lorem: LOREM,
106-
music: MUSIC,
107-
name: NAME,
108-
phone_number: PHONE_NUMBER,
109-
system: SYSTEM,
110-
vehicle: VEHICLE,
111-
word: WORD,
112-
};

src/definitions/finance.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to finances.
53
*/
@@ -38,13 +36,3 @@ export interface FinanceCurrencyEntryDefinitions {
3836
*/
3937
symbol: string;
4038
}
41-
42-
/**
43-
* Internal: A list of all keys for the FinanceDefinitions.
44-
*/
45-
export const FINANCE = allOf<keyof FinanceDefinitions>()(
46-
'account_type',
47-
'credit_card',
48-
'currency',
49-
'transaction_type'
50-
);

src/definitions/hacker.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { allOf } from './utils';
2-
31
/**
42
* The possible definitions related to computers.
53
*/
@@ -33,15 +31,3 @@ export interface HackerDefinitions {
3331
*/
3432
verb: string[];
3533
}
36-
37-
/**
38-
* Internal: A list of all keys for the HackerDefinitions.
39-
*/
40-
export const HACKER = allOf<keyof HackerDefinitions>()(
41-
'abbreviation',
42-
'adjective',
43-
'ingverb',
44-
'noun',
45-
'phrase',
46-
'verb'
47-
);

src/definitions/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export type {
77
export type { CompanyDefinitions } from './company';
88
export type { DatabaseDefinitions } from './database';
99
export type { DateDefinitions, DateEntryDefinition } from './date';
10-
export { DEFINITIONS } from './definitions';
1110
export type { DefinitionTypes, LocaleDefinition } from './definitions';
1211
export type {
1312
FinanceCurrencyEntryDefinitions,

0 commit comments

Comments
 (0)