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

fix: move utils to the correct place #2964

Draft
wants to merge 5 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import { ScienceModule } from './modules/science';
import { SystemModule } from './modules/system';
import { VehicleModule } from './modules/vehicle';
import { WordModule } from './modules/word';
import type { Randomizer } from './randomizer';
import { SimpleFaker } from './simple-faker';
import { mergeLocales } from './utils/merge-locales';
import type { Randomizer } from './utils/randomizer';

/**
* This is Faker's main class containing all modules that can be used to generate data.
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ export type { StringModule } from './modules/string';
export type { SystemModule } from './modules/system';
export type { VehicleModule } from './modules/vehicle';
export type { WordModule } from './modules/word';
export type { Randomizer } from './randomizer';
export { SimpleFaker, simpleFaker } from './simple-faker';
export { mergeLocales } from './utils/merge-locales';
export type { Randomizer } from './utils/randomizer';
2 changes: 1 addition & 1 deletion src/internal/mersenne.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also move the

export function generateMersenne32Randomizer(): Randomizer {

And the 53bit variant to src/utils/mersenne.ts

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Randomizer } from '../randomizer';
import type { Randomizer } from '../utils/randomizer';

/**
* Copyright (c) 2022-2023 Faker
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/modules/string/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FakerError } from '../../errors/faker-error';
import { SimpleModuleBase } from '../../internal/module-base';
import type { LiteralUnion } from '../../utils/types';
import type { LiteralUnion } from '../../internal/types';

export type Casing = 'upper' | 'lower' | 'mixed';

Expand Down
2 changes: 1 addition & 1 deletion src/simple-faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SimpleDateModule } from './modules/date';
import { SimpleHelpersModule } from './modules/helpers';
import { NumberModule } from './modules/number';
import { StringModule } from './modules/string';
import type { Randomizer } from './randomizer';
import type { Randomizer } from './utils/randomizer';

/**
* This is a simplified Faker class that doesn't need any localized data to generate its output.
Expand Down
ST-DDT marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
2 changes: 1 addition & 1 deletion test/internal/mersenne.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
generateMersenne32Randomizer,
generateMersenne53Randomizer,
} from '../../src/internal/mersenne';
import type { Randomizer } from '../../src/randomizer';
import type { Randomizer } from '../../src/utils/randomizer';
import { seededRuns } from '../support/seeded-runs';
import { times } from '../support/times';
import {
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/apidocs/method.example.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Casing, ColorFormat } from '../../../src';
import { FakerError } from '../../../src/errors/faker-error';
import type { LiteralUnion } from '../../../src/internal/types';
import type { AlphaNumericChar } from '../../../src/modules/string';
import type { LiteralUnion } from '../../../src/utils/types';
// explicitly export types so they show up in the docs as decomposed types
export type { NumberColorFormat, StringColorFormat } from '../../../src';
export type { AlphaNumericChar, Casing, ColorFormat, LiteralUnion };
Expand Down
2 changes: 1 addition & 1 deletion test/support/seeded-runs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, describe as vi_describe, it as vi_it } from 'vitest';
import type { Faker } from '../../src/faker';
import type { Callable, MethodOf } from '../../src/utils/types';
import type { Callable, MethodOf } from '../../src/internal/types';

export const seededRuns = [42, 1337, 1211];

Expand Down
Loading