From 2e675d91358c1ade601441996dc61c42ef1d61f0 Mon Sep 17 00:00:00 2001 From: Patrick Roza Date: Thu, 28 Mar 2024 09:29:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20dual-packages=20hazard=20a?= =?UTF-8?q?nd=20types=20incompatibility=20(#4842)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .yarn/versions/1488efe6.yml | 8 ++++++++ .../src/arbitrary/_internals/helpers/DepthContext.ts | 7 +++++-- .../fast-check/src/check/arbitrary/definition/Value.ts | 1 + .../src/check/precondition/PreconditionFailure.ts | 2 ++ packages/fast-check/src/random/generator/Random.ts | 1 + packages/fast-check/src/stream/Stream.ts | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .yarn/versions/1488efe6.yml diff --git a/.yarn/versions/1488efe6.yml b/.yarn/versions/1488efe6.yml new file mode 100644 index 00000000000..0732a3208fb --- /dev/null +++ b/.yarn/versions/1488efe6.yml @@ -0,0 +1,8 @@ +releases: + fast-check: patch + +declined: + - "@fast-check/ava" + - "@fast-check/jest" + - "@fast-check/vitest" + - "@fast-check/worker" diff --git a/packages/fast-check/src/arbitrary/_internals/helpers/DepthContext.ts b/packages/fast-check/src/arbitrary/_internals/helpers/DepthContext.ts index 94e91d1d561..75ecc95b265 100644 --- a/packages/fast-check/src/arbitrary/_internals/helpers/DepthContext.ts +++ b/packages/fast-check/src/arbitrary/_internals/helpers/DepthContext.ts @@ -1,6 +1,6 @@ /** * Internal symbol used to declare an opaque type for DepthIdentifier - * @public + * @internal */ declare const depthIdentifierSymbol: unique symbol; @@ -11,7 +11,10 @@ declare const depthIdentifierSymbol: unique symbol; * @remarks Since 2.25.0 * @public */ -export type DepthIdentifier = { [depthIdentifierSymbol]: true }; +export type DepthIdentifier = { + /** @internal */ + [depthIdentifierSymbol]: true; +} & DepthContext; /** * Instance of depth, can be used to alter the depth perceived by an arbitrary diff --git a/packages/fast-check/src/check/arbitrary/definition/Value.ts b/packages/fast-check/src/check/arbitrary/definition/Value.ts index 61f521cf740..9f07110b2c4 100644 --- a/packages/fast-check/src/check/arbitrary/definition/Value.ts +++ b/packages/fast-check/src/check/arbitrary/definition/Value.ts @@ -18,6 +18,7 @@ export class Value { */ readonly hasToBeCloned: boolean; /** + * @internal * Flag indicating whether or not the this.value has already been called once * If so, the underlying will be cloned * Only set when hasToBeCloned = true diff --git a/packages/fast-check/src/check/precondition/PreconditionFailure.ts b/packages/fast-check/src/check/precondition/PreconditionFailure.ts index 1f6c2e45c8d..97ffd2f6580 100644 --- a/packages/fast-check/src/check/precondition/PreconditionFailure.ts +++ b/packages/fast-check/src/check/precondition/PreconditionFailure.ts @@ -4,7 +4,9 @@ * @public */ export class PreconditionFailure extends Error { + /** @internal */ private static readonly SharedFootPrint: symbol = Symbol('fast-check/PreconditionFailure'); + /** @internal */ private readonly footprint: symbol; constructor(readonly interruptExecution: boolean = false) { super(); diff --git a/packages/fast-check/src/random/generator/Random.ts b/packages/fast-check/src/random/generator/Random.ts index 669ee75dc4a..33aa27b06a4 100644 --- a/packages/fast-check/src/random/generator/Random.ts +++ b/packages/fast-check/src/random/generator/Random.ts @@ -17,6 +17,7 @@ export class Random { private static DBL_FACTOR: number = Math.pow(2, 27); private static DBL_DIVISOR: number = Math.pow(2, -53); + /** @internal */ private internalRng: RandomGenerator; /** diff --git a/packages/fast-check/src/stream/Stream.ts b/packages/fast-check/src/stream/Stream.ts index f54193150d3..29d49520464 100644 --- a/packages/fast-check/src/stream/Stream.ts +++ b/packages/fast-check/src/stream/Stream.ts @@ -43,7 +43,7 @@ export class Stream implements IterableIterator { * Create a Stream based on `g` * @param g - Underlying data of the Stream */ - constructor(private readonly g: IterableIterator) { + constructor(/** @internal */ private readonly g: IterableIterator) { // /*DEBUG*/ this.isLive = true; }