Skip to content

Commit cb28b85

Browse files
committed
refactor: get rid of export =
1 parent 7e21de2 commit cb28b85

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Faker supports incremental loading of locales.
175175

176176
```js
177177
// loads only de locale
178-
const faker = require('@faker-js/faker/locale/de');
178+
const { faker } = require('@faker-js/faker/locale/de');
179179
```
180180

181181
## Setting a randomness seed

docs/api/localization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ In a production environment, you may only want to include the locale data for a
8888

8989
```js
9090
// loads only de locale
91-
const faker = require('@faker-js/faker/locale/de');
91+
const { faker } = require('@faker-js/faker/locale/de');
9292
```

test/locale-imports.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import allLocales from '../src/locales';
33

44
describe('locale imports', () => {
55
for (const locale in allLocales) {
6-
it(`should be possible to directly require('@faker-js/faker/locale/${locale}').default`, () => {
6+
it(`should be possible to directly require('@faker-js/faker/locale/${locale}')`, () => {
77
// eslint-disable-next-line @typescript-eslint/no-var-requires
8-
const faker = require(`../dist/cjs/locale/${locale}`).default;
8+
const { faker } = require(`../dist/cjs/locale/${locale}`);
99

1010
expect(faker).toBeDefined();
1111
expect(faker.locale).toBe(locale);
1212
});
1313

1414
// Internal test to cover `src/locale/*.ts`
15-
it(`should be possible to directly require('../locale/${locale}').default`, () => {
15+
it(`should be possible to directly require('../locale/${locale}')`, () => {
1616
// eslint-disable-next-line @typescript-eslint/no-var-requires
17-
const faker = require(`../locale/${locale}`).default;
17+
const { faker } = require(`../locale/${locale}`);
1818

1919
expect(faker).toBeDefined();
2020
expect(faker.locale).toBe(locale);

0 commit comments

Comments
 (0)