Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove obsolete definition key constants #910

Merged
merged 1 commit into from
May 3, 2022
Merged
Show file tree
Hide file tree
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
35 changes: 0 additions & 35 deletions src/definitions/address.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to addresses.
*/
Expand Down Expand Up @@ -99,36 +97,3 @@ export interface AddressDefinitions {
// A list of timezones names.
time_zone: string[];
}

/**
* Internal: A list of all keys for the AddressDefinitions.
*/
export const ADDRESS = allOf<keyof AddressDefinitions>()(
'postcode_by_state',
'postcode',

'city_name',
'city_prefix',
'city_suffix',

'country',
'state',
'state_abbr',
'county',

'direction_abbr',
'direction',

'building_number',

'street_prefix',
'street_suffix',

'street_address',
'secondary_address',

'country_code',
'country_code_alpha_3',

'time_zone'
);
22 changes: 0 additions & 22 deletions src/definitions/animal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to animals.
*/
Expand All @@ -19,23 +17,3 @@ export interface AnimalDefinitions {
snake: string[];
type: string[];
}

/**
* Internal: A list of all keys for the AnimalDefinitions.
*/
export const ANIMAL = allOf<keyof AnimalDefinitions>()(
'dog',
'cat',
'snake',
'bear',
'lion',
'cetacean',
'insect',
'crocodilia',
'cow',
'bird',
'fish',
'rabbit',
'horse',
'type'
);
12 changes: 0 additions & 12 deletions src/definitions/commerce.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to commerce.
*/
Expand Down Expand Up @@ -39,13 +37,3 @@ export interface CommerceProductNameDefinitions {
*/
product: string[];
}

/**
* Internal: A list of all keys for the CommerceDefinitions.
*/
export const COMMERCE = allOf<keyof CommerceDefinitions>()(
'color',
'department',
'product_name',
'product_description'
);
17 changes: 0 additions & 17 deletions src/definitions/company.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to companies.
*/
Expand Down Expand Up @@ -33,18 +31,3 @@ export interface CompanyDefinitions {
*/
suffix: string[];
}

/**
* Internal: A list of all keys for the CompanyDefinitions.
*/
export const COMPANY = allOf<keyof CompanyDefinitions>()(
'bs_adjective',
'bs_noun',
'bs_verb',

'adjective',
'descriptor',
'noun',

'suffix'
);
12 changes: 0 additions & 12 deletions src/definitions/database.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to databases.
*/
Expand All @@ -21,13 +19,3 @@ export interface DatabaseDefinitions {
*/
type: string[];
}

/**
* Internal: A list of all keys for the DatabaseDefinitions.
*/
export const DATABASE = allOf<keyof DatabaseDefinitions>()(
'collation',
'column',
'engine',
'type'
);
7 changes: 0 additions & 7 deletions src/definitions/date.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to dates.
*/
Expand Down Expand Up @@ -37,8 +35,3 @@ export interface DateEntryDefinition {
*/
abbr_context?: string[];
}

/**
* Internal: A list of all keys for the DateDefinitions.
*/
export const DATE = allOf<keyof DateDefinitions>()('month', 'weekday');
42 changes: 0 additions & 42 deletions src/definitions/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
import type { AddressDefinitions } from './address';
import { ADDRESS } from './address';
import type { AnimalDefinitions } from './animal';
import { ANIMAL } from './animal';
import type { CommerceDefinitions } from './commerce';
import { COMMERCE } from './commerce';
import type { CompanyDefinitions } from './company';
import { COMPANY } from './company';
import type { DatabaseDefinitions } from './database';
import { DATABASE } from './database';
import type { DateDefinitions } from './date';
import { DATE } from './date';
import type { FinanceDefinitions } from './finance';
import { FINANCE } from './finance';
import type { HackerDefinitions } from './hacker';
import { HACKER } from './hacker';
import type { InternetDefinitions } from './internet';
import { INTERNET } from './internet';
import type { LoremDefinitions } from './lorem';
import { LOREM } from './lorem';
import type { MusicDefinitions } from './music';
import { MUSIC } from './music';
import type { NameDefinitions } from './name';
import { NAME } from './name';
import type { PhoneNumberDefinitions } from './phone_number';
import { PHONE_NUMBER } from './phone_number';
import type { SystemDefinitions } from './system';
import { SYSTEM } from './system';
import type { VehicleDefinitions } from './vehicle';
import { VEHICLE } from './vehicle';
import type { WordDefinitions } from './word';
import { WORD } from './word';

/**
* The definitions as used by the Faker modules.
Expand Down Expand Up @@ -84,29 +68,3 @@ export type DefinitionTypes = {
} & {
readonly [module in keyof Definitions]: Array<keyof Definitions[module]>;
};

/**
* Internal: List off all modules and their properties,
* that needs to have a fallback generated in Faker.loadDefinitions().
*/
export const DEFINITIONS: DefinitionTypes = {
title: 'metadata',
separator: 'metadata',

address: ADDRESS,
animal: ANIMAL,
company: COMPANY,
commerce: COMMERCE,
database: DATABASE,
date: DATE,
finance: FINANCE,
hacker: HACKER,
internet: INTERNET,
lorem: LOREM,
music: MUSIC,
name: NAME,
phone_number: PHONE_NUMBER,
system: SYSTEM,
vehicle: VEHICLE,
word: WORD,
};
12 changes: 0 additions & 12 deletions src/definitions/finance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to finances.
*/
Expand Down Expand Up @@ -38,13 +36,3 @@ export interface FinanceCurrencyEntryDefinitions {
*/
symbol: string;
}

/**
* Internal: A list of all keys for the FinanceDefinitions.
*/
export const FINANCE = allOf<keyof FinanceDefinitions>()(
'account_type',
'credit_card',
'currency',
'transaction_type'
);
14 changes: 0 additions & 14 deletions src/definitions/hacker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to computers.
*/
Expand Down Expand Up @@ -33,15 +31,3 @@ export interface HackerDefinitions {
*/
verb: string[];
}

/**
* Internal: A list of all keys for the HackerDefinitions.
*/
export const HACKER = allOf<keyof HackerDefinitions>()(
'abbreviation',
'adjective',
'ingverb',
'noun',
'phrase',
'verb'
);
1 change: 0 additions & 1 deletion src/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type {
export type { CompanyDefinitions } from './company';
export type { DatabaseDefinitions } from './database';
export type { DateDefinitions, DateEntryDefinition } from './date';
export { DEFINITIONS } from './definitions';
export type { DefinitionTypes, LocaleDefinition } from './definitions';
export type {
FinanceCurrencyEntryDefinitions,
Expand Down
11 changes: 0 additions & 11 deletions src/definitions/internet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { EmojiType } from '../internet';
import { allOf } from './utils';

/**
* The possible definitions related to internet stuff.
Expand All @@ -22,13 +21,3 @@ export interface InternetDefinitions {
*/
emoji: Record<EmojiType, string[]>;
}

/**
* Internal: A list of all keys for the InternetDefinitions.
*/
export const INTERNET = allOf<keyof InternetDefinitions>()(
'domain_suffix',
'example_email',
'free_email',
'emoji'
);
7 changes: 0 additions & 7 deletions src/definitions/lorem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to lorem texts.
*/
Expand All @@ -9,8 +7,3 @@ export interface LoremDefinitions {
*/
words: string[];
}

/**
* Internal: A list of all keys for the LoremDefinitions.
*/
export const LOREM = allOf<keyof LoremDefinitions>()('words');
7 changes: 0 additions & 7 deletions src/definitions/music.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to music.
*/
Expand All @@ -9,8 +7,3 @@ export interface MusicDefinitions {
*/
genre: string[];
}

/**
* Internal: A list of all keys for the MusicDefinitions.
*/
export const MUSIC = allOf<keyof MusicDefinitions>()('genre');
32 changes: 0 additions & 32 deletions src/definitions/name.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to people's names.
*/
Expand Down Expand Up @@ -41,33 +39,3 @@ export interface NameTitleDefinitions {
job: string[];
level?: string[];
}

/**
* Internal: A list of all keys for the NameDefinitions.
*/
export const NAME = allOf<keyof NameDefinitions>()(
'gender',
'binary_gender',

'prefix',
'female_prefix',
'male_prefix',

'first_name',
'female_first_name',
'male_first_name',

'middle_name',
'female_middle_name',
'male_middle_name',

'last_name',
'female_last_name',
'male_last_name',

'suffix',

'name',

'title'
);
7 changes: 0 additions & 7 deletions src/definitions/phone_number.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to phone numbers.
*/
Expand All @@ -14,8 +12,3 @@ export interface PhoneNumberDefinitions {
*/
formats: string[];
}

/**
* Internal: A list of all keys for the PhoneNumberDefinitions.
*/
export const PHONE_NUMBER = allOf<keyof PhoneNumberDefinitions>()('formats');
10 changes: 0 additions & 10 deletions src/definitions/system.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { allOf } from './utils';

/**
* The possible definitions related to files and the system.
*/
Expand All @@ -23,11 +21,3 @@ export interface SystemMimeTypeEntryDefinitions {
compressible?: boolean;
charset?: string;
}

/**
* Internal: A list of all keys for the SystemDefinitions.
*/
export const SYSTEM = allOf<keyof SystemDefinitions>()(
'directoryPaths',
'mimeTypes'
);
Loading