From 680a672a380aee54b1f248ac73ef6a59b0dfd9f6 Mon Sep 17 00:00:00 2001 From: Nicolas DUBIEN Date: Wed, 25 Sep 2024 00:47:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Do=20not=20export=20mersenne=20a?= =?UTF-8?q?s=20default=20(#738)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/generator/MersenneTwister.ts | 2 +- src/pure-rand-default.ts | 2 +- .../unit/distribution/UniformArrayIntDistribution.noreg.spec.ts | 2 +- test/unit/distribution/UniformBigIntDistribution.noreg.spec.ts | 2 +- test/unit/distribution/UniformBigIntDistribution.spec.ts | 2 +- test/unit/distribution/UniformIntDistribution.noreg.spec.ts | 2 +- test/unit/generator/MersenneTwister.spec.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/generator/MersenneTwister.ts b/src/generator/MersenneTwister.ts index c730fa1c..61cebf6d 100644 --- a/src/generator/MersenneTwister.ts +++ b/src/generator/MersenneTwister.ts @@ -91,7 +91,7 @@ function fromState(state: readonly number[]): RandomGenerator { return MersenneTwister.fromState(state); } -export default Object.assign( +export const mersenne = Object.assign( function (seed: number): RandomGenerator { return MersenneTwister.from(seed); }, diff --git a/src/pure-rand-default.ts b/src/pure-rand-default.ts index 075a01bc..eb831d1e 100644 --- a/src/pure-rand-default.ts +++ b/src/pure-rand-default.ts @@ -1,6 +1,6 @@ import type { RandomGenerator } from './types/RandomGenerator'; import { congruential32 } from './generator/LinearCongruential'; -import mersenne from './generator/MersenneTwister'; +import { mersenne } from './generator/MersenneTwister'; import { xorshift128plus } from './generator/XorShift'; import { xoroshiro128plus } from './generator/XoroShiro'; diff --git a/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts b/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts index 626eb12b..479b0808 100644 --- a/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts +++ b/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts @@ -2,7 +2,7 @@ import fc from 'fast-check'; import { ArrayInt } from '../../../src/distribution/internals/ArrayInt'; import { uniformArrayIntDistribution } from '../../../src/distribution/UniformArrayIntDistribution'; -import mersenne from '../../../src/generator/MersenneTwister'; +import { mersenne } from '../../../src/generator/MersenneTwister'; import { RandomGenerator } from '../../../src/types/RandomGenerator'; describe('uniformArrayIntDistribution [non regression]', () => { diff --git a/test/unit/distribution/UniformBigIntDistribution.noreg.spec.ts b/test/unit/distribution/UniformBigIntDistribution.noreg.spec.ts index 00b57fc2..404f5ece 100644 --- a/test/unit/distribution/UniformBigIntDistribution.noreg.spec.ts +++ b/test/unit/distribution/UniformBigIntDistribution.noreg.spec.ts @@ -1,5 +1,5 @@ import { uniformBigIntDistribution } from '../../../src/distribution/UniformBigIntDistribution'; -import mersenne from '../../../src/generator/MersenneTwister'; +import { mersenne } from '../../../src/generator/MersenneTwister'; import { RandomGenerator } from '../../../src/types/RandomGenerator'; describe('uniformBigIntDistribution [non regression]', () => { diff --git a/test/unit/distribution/UniformBigIntDistribution.spec.ts b/test/unit/distribution/UniformBigIntDistribution.spec.ts index 6883d9ab..0dbefedb 100644 --- a/test/unit/distribution/UniformBigIntDistribution.spec.ts +++ b/test/unit/distribution/UniformBigIntDistribution.spec.ts @@ -3,7 +3,7 @@ import * as fc from 'fast-check'; import { uniformBigIntDistribution } from '../../../src/distribution/UniformBigIntDistribution'; import { uniformIntDistribution } from '../../../src/distribution/UniformIntDistribution'; -import mersenne from '../../../src/generator/MersenneTwister'; +import { mersenne } from '../../../src/generator/MersenneTwister'; const bigIntArbitrary = fc .tuple(fc.boolean(), fc.nat(0xffffffff), fc.nat(0xffffffff), fc.nat(0xffffffff), fc.nat(0xffffffff)) diff --git a/test/unit/distribution/UniformIntDistribution.noreg.spec.ts b/test/unit/distribution/UniformIntDistribution.noreg.spec.ts index ed4d5a89..2f3c0843 100644 --- a/test/unit/distribution/UniformIntDistribution.noreg.spec.ts +++ b/test/unit/distribution/UniformIntDistribution.noreg.spec.ts @@ -1,7 +1,7 @@ import fc from 'fast-check'; import { uniformIntDistribution } from '../../../src/distribution/UniformIntDistribution'; -import mersenne from '../../../src/generator/MersenneTwister'; +import { mersenne } from '../../../src/generator/MersenneTwister'; import { RandomGenerator } from '../../../src/types/RandomGenerator'; describe('uniformIntDistribution [non regression]', () => { diff --git a/test/unit/generator/MersenneTwister.spec.ts b/test/unit/generator/MersenneTwister.spec.ts index 04623727..987befc8 100644 --- a/test/unit/generator/MersenneTwister.spec.ts +++ b/test/unit/generator/MersenneTwister.spec.ts @@ -1,7 +1,7 @@ import * as assert from 'assert'; import * as fc from 'fast-check'; -import mersenne from '../../../src/generator/MersenneTwister'; +import { mersenne } from '../../../src/generator/MersenneTwister'; import * as p from './RandomGenerator.properties'; describe('mersenne', () => {