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: Migrate en to ts #236

Closed
wants to merge 2 commits into from
Closed
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
25 changes: 17 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import { Hacker } from './hacker';
import { Helpers } from './helpers';
import { Image } from './image';
import { Internet } from './internet';
import { MonthsDefinition } from './locales/en/date/month';
import { WeeksDefinition } from './locales/en/date/weekday';
import { CreditCardDefinition } from './locales/en/finance/credit_card';
import { CurrencyDefinition } from './locales/en/finance/currency';
import { MimeTypesDefinition } from './locales/en/system/mimeTypes';
import { Lorem } from './lorem';
import { Mersenne } from './mersenne';
import { Music } from './music';
Expand All @@ -24,6 +29,10 @@ import { Unique } from './unique';
import { Vehicle } from './vehicle';
import { Word } from './word';

export interface LocaleDefinitionObject {
[index: string]: any;
}

export interface LocaleDefinition {
title: string;
separator?: string;
Expand Down Expand Up @@ -84,7 +93,7 @@ export interface LocaleDefinition {
color: any[];
department: any[];
product_description: any[];
product_name: any[];
product_name: LocaleDefinitionObject;
}>;
company?: Partial<{
adjective: any[];
Expand All @@ -103,13 +112,13 @@ export interface LocaleDefinition {
type: any[];
}>;
date?: Partial<{
month: any[];
weekday: any[];
month: MonthsDefinition;
weekday: WeeksDefinition;
}>;
finance?: Partial<{
account_type: any[];
credit_card: any[];
currency: any[];
credit_card: CreditCardDefinition;
currency: CurrencyDefinition;
transaction_type: any[];
}>;
hacker?: Partial<{
Expand Down Expand Up @@ -149,18 +158,18 @@ export interface LocaleDefinition {
name: string[];
prefix: string[];
suffix: string[];
title: {
title: Partial<{
descriptor?: string[];
job: string[];
level?: string[];
};
}>;
}>;
phone_number?: Partial<{
formats: any[];
}>;
system?: Partial<{
directoryPaths: any[];
mimeTypes: any[];
mimeTypes: MimeTypesDefinition;
}>;
team?: Partial<{
creature: any[];
Expand Down
1 change: 0 additions & 1 deletion src/locales/en/address/building_number.js

This file was deleted.

1 change: 1 addition & 0 deletions src/locales/en/address/building_number.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const building_number: string[] = ['#####', '####', '###'];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const city: string[] = [
'#{city_prefix} #{Name.first_name}#{city_suffix}',
'#{city_prefix} #{Name.first_name}',
'#{Name.first_name}#{city_suffix}',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = [
export const city_name: string[] = [
'Abilene',
'Akron',
'Alafaya',
Expand Down
1 change: 0 additions & 1 deletion src/locales/en/address/city_prefix.js

This file was deleted.

9 changes: 9 additions & 0 deletions src/locales/en/address/city_prefix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const city_prefix: string[] = [
'North',
'East',
'West',
'South',
'New',
'Lake',
'Port',
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const city_suffix: string[] = [
'town',
'ton',
'land',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const country: string[] = [
'Afghanistan',
'Albania',
'Algeria',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const country_code: string[] = [
'AD',
'AE',
'AF',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const country_code_alpha_3: string[] = [
'BGD',
'BEL',
'BFA',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const county: string[] = [
'Avon',
'Bedfordshire',
'Berkshire',
Expand Down
1 change: 0 additions & 1 deletion src/locales/en/address/default_country.js

This file was deleted.

1 change: 1 addition & 0 deletions src/locales/en/address/default_country.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const default_country: string[] = ['United States of America'];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const direction: string[] = [
'North',
'East',
'South',
Expand Down
1 change: 0 additions & 1 deletion src/locales/en/address/direction_abbr.js

This file was deleted.

10 changes: 10 additions & 0 deletions src/locales/en/address/direction_abbr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const direction_abbr: string[] = [
'N',
'E',
'S',
'W',
'NE',
'NW',
'SE',
'SW',
];
23 changes: 0 additions & 23 deletions src/locales/en/address/index.js

This file was deleted.

44 changes: 44 additions & 0 deletions src/locales/en/address/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { state, street_name, street_address } from '../../ar/address';
import { time_zone } from '../../es/address';
import { building_number } from './building_number';
import { city } from './city';
import { city_name } from './city_name';
import { city_prefix } from './city_prefix';
import { city_suffix } from './city_suffix';
import { country } from './country';
import { country_code } from './country_code';
import { country_code_alpha_3 } from './country_code_alpha_3';
import { county } from './county';
import { default_country } from './default_country';
import { direction } from './direction';
import { direction_abbr } from './direction_abbr';
import { postcode } from './postcode';
import { postcode_by_state } from './postcode_by_state';
import { secondary_address } from './secondary_address';
import { state_abbr } from './state_abbr';
import { street_suffix } from './street_suffix';

export const address = {
city_prefix: city_prefix,
city_suffix: city_suffix,
city_name: city_name,
county: county,
country: country,
country_code: country_code,
country_code_alpha_3: country_code_alpha_3,
building_number: building_number,
street_suffix: street_suffix,
secondary_address: secondary_address,
postcode: postcode,
postcode_by_state: postcode_by_state,
state: state,
state_abbr: state_abbr,
time_zone: time_zone,
city: city,
street_name: street_name,
street_address: street_address,
default_country: default_country,
direction: direction,
direction_abbr: direction_abbr,
};
export default address;
1 change: 0 additions & 1 deletion src/locales/en/address/postcode.js

This file was deleted.

1 change: 1 addition & 0 deletions src/locales/en/address/postcode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const postcode: string[] = ['#####', '#####-####'];
1 change: 0 additions & 1 deletion src/locales/en/address/postcode_by_state.js

This file was deleted.

1 change: 1 addition & 0 deletions src/locales/en/address/postcode_by_state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const postcode_by_state: string[] = ['#####', '#####-####'];
1 change: 0 additions & 1 deletion src/locales/en/address/secondary_address.js

This file was deleted.

1 change: 1 addition & 0 deletions src/locales/en/address/secondary_address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const secondary_address: string[] = ['Apt. ###', 'Suite ###'];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const state: string[] = [
'Alabama',
'Alaska',
'Arizona',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const state_abbr: string[] = [
'AL',
'AK',
'AZ',
Expand Down
1 change: 0 additions & 1 deletion src/locales/en/address/street_address.js

This file was deleted.

1 change: 1 addition & 0 deletions src/locales/en/address/street_address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const street_name: string[] = ['#{building_number} #{street_name}'];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const street_name: string[] = [
'#{Name.first_name} #{street_suffix}',
'#{Name.last_name} #{street_suffix}',
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const street_suffix: string[] = [
'Alley',
'Avenue',
'Branch',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const time_zone: string[] = [
'Pacific/Midway',
'Pacific/Pago_Pago',
'Pacific/Honolulu',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const bear: string[] = [
'Giant panda',
'Spectacled bear',
'Sun bear',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const bird: string[] = [
'Red-throated Loon',
'Arctic Loon',
'Pacific Loon',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const cat: string[] = [
'Abyssinian',
'American Bobtail',
'American Curl',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const cetacean: string[] = [
'Blue Whale',
'Fin Whale',
'Sei Whale',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const cow: string[] = [
'Aberdeen Angus',
'Abergele',
'Abigar',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module['exports'] = [
export const crocodilia: string[] = [
'Alligator mississippiensis',
'Chinese Alligator',
'Black Caiman',
'Broad-snouted Caiman',
'Spectacled Caiman',
'Yacare Caiman',
'Cuviers Dwarf Caiman',
'Schneiders Smooth-fronted Caiman',
`Cuvier's Dwarf Caiman`,
`Schneider's Smooth-fronted Caiman`,
'African Slender-snouted Crocodile',
'American Crocodile',
'Australian Freshwater Crocodile',
'Cuban Crocodile',
'Dwarf Crocodile',
'Morelets Crocodile',
`Morelet's Crocodile`,
'Mugger Crocodile',
'New Guinea Freshwater Crocodile',
'Nile Crocodile',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const dog: string[] = [
'Affenpinscher',
'Afghan Hound',
'Aidi',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const fish: string[] = [
'Grass carp',
'Peruvian anchoveta',
'Silver carp',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const horse: string[] = [
'American Albino',
'Abaco Barb',
'Abtenauer',
Expand Down
16 changes: 0 additions & 16 deletions src/locales/en/animal/index.js

This file was deleted.

31 changes: 31 additions & 0 deletions src/locales/en/animal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { type } from './type';
import { bear } from './bear';
import { bird } from './bird';
import { cat } from './cat';
import { cetacean } from './cetacean';
import { cow } from './cow';
import { crocodilia } from './crocodilia';
import { dog } from './dog';
import { fish } from './fish';
import { horse } from './horse';
import { insect } from './insect';
import { lion } from './lion';
import { rabbit } from './rabbit';
import { snake } from './snake';

export const animal = {
dog: dog,
cat: cat,
snake: snake,
horse: horse,
cetacean: cetacean,
rabbit: rabbit,
insect: insect,
bear: bear,
lion: lion,
cow: cow,
bird: bird,
fish: fish,
crocodilia: crocodilia,
type: type,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const insect: string[] = [
'Acacia-ants',
'Acorn-plum gall',
'Aerial yellowjacket',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module['exports'] = [
export const lion: string[] = [
'Asiatic Lion',
'Barbary Lion',
'West African Lion',
Expand Down
Loading