Skip to content

Commit

Permalink
refactor!: get rid of export = (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored May 3, 2022
1 parent cc9aec7 commit 20fbeaf
Show file tree
Hide file tree
Showing 61 changed files with 81 additions and 181 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Faker supports incremental loading of locales.

```js
// loads only de locale
const faker = require('@faker-js/faker/locale/de');
const { faker } = require('@faker-js/faker/locale/de');
```

## Setting a randomness seed
Expand Down
2 changes: 1 addition & 1 deletion docs/api/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ In a production environment, you may only want to include the locale data for a

```js
// loads only de locale
const faker = require('@faker-js/faker/locale/de');
const { faker } = require('@faker-js/faker/locale/de');
```
4 changes: 1 addition & 3 deletions scripts/generateLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ function generateLocaleFile(locale: string): void {
import ${locale} from '../locales/${locale}';
${locale !== 'en' ? "import en from '../locales/en';" : ''}
const faker = new Faker({
export const faker = new Faker({
locale: '${locale}',
localeFallback: 'en',
locales: {
${locale},
${locale !== 'en' ? 'en,' : ''}
},
});
export = faker;
`;

content = format(content, prettierTsOptions);
Expand Down
4 changes: 1 addition & 3 deletions src/locale/af_ZA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import af_ZA from '../locales/af_ZA';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'af_ZA',
localeFallback: 'en',
locales: {
af_ZA,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import ar from '../locales/ar';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'ar',
localeFallback: 'en',
locales: {
ar,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/az.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import az from '../locales/az';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'az',
localeFallback: 'en',
locales: {
az,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/cz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import cz from '../locales/cz';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'cz',
localeFallback: 'en',
locales: {
cz,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import de from '../locales/de';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'de',
localeFallback: 'en',
locales: {
de,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/de_AT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import de_AT from '../locales/de_AT';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'de_AT',
localeFallback: 'en',
locales: {
de_AT,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/de_CH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import de_CH from '../locales/de_CH';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'de_CH',
localeFallback: 'en',
locales: {
de_CH,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import el from '../locales/el';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'el',
localeFallback: 'en',
locales: {
el,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
import { Faker } from '../faker';
import en from '../locales/en';

const faker = new Faker({
export const faker = new Faker({
locale: 'en',
localeFallback: 'en',
locales: {
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_AU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_AU from '../locales/en_AU';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_AU',
localeFallback: 'en',
locales: {
en_AU,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_AU_ocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_AU_ocker from '../locales/en_AU_ocker';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_AU_ocker',
localeFallback: 'en',
locales: {
en_AU_ocker,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_BORK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_BORK from '../locales/en_BORK';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_BORK',
localeFallback: 'en',
locales: {
en_BORK,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_CA from '../locales/en_CA';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_CA',
localeFallback: 'en',
locales: {
en_CA,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_GB from '../locales/en_GB';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_GB',
localeFallback: 'en',
locales: {
en_GB,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_GH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_GH from '../locales/en_GH';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_GH',
localeFallback: 'en',
locales: {
en_GH,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_IE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_IE from '../locales/en_IE';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_IE',
localeFallback: 'en',
locales: {
en_IE,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_IND.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_IND from '../locales/en_IND';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_IND',
localeFallback: 'en',
locales: {
en_IND,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_NG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_NG from '../locales/en_NG';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_NG',
localeFallback: 'en',
locales: {
en_NG,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_US from '../locales/en_US';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_US',
localeFallback: 'en',
locales: {
en_US,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/en_ZA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import en_ZA from '../locales/en_ZA';

const faker = new Faker({
export const faker = new Faker({
locale: 'en_ZA',
localeFallback: 'en',
locales: {
en_ZA,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import es from '../locales/es';

const faker = new Faker({
export const faker = new Faker({
locale: 'es',
localeFallback: 'en',
locales: {
es,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/es_MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import es_MX from '../locales/es_MX';

const faker = new Faker({
export const faker = new Faker({
locale: 'es_MX',
localeFallback: 'en',
locales: {
es_MX,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/fa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import fa from '../locales/fa';

const faker = new Faker({
export const faker = new Faker({
locale: 'fa',
localeFallback: 'en',
locales: {
fa,
en,
},
});

export = faker;
4 changes: 1 addition & 3 deletions src/locale/fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { Faker } from '../faker';
import en from '../locales/en';
import fi from '../locales/fi';

const faker = new Faker({
export const faker = new Faker({
locale: 'fi',
localeFallback: 'en',
locales: {
fi,
en,
},
});

export = faker;
Loading

0 comments on commit 20fbeaf

Please sign in to comment.