Repository: dubzzz/fast-check
Pull request #2085 (2021-07-07 06:57:34)

🚚 Move object arbitraries into /arbitrary
<!-- Context of the PR: short description and potentially linked issues -->

<!-- ...a few words to describe the content of this PR...               -->
<!-- ... -->

<!-- Type of PR: [ ] unchecked / [ ] checked -->
**_Category:_**

- [ ] ✨ Introduce new features
- [ ] 📝 Add or update documentation
- [ ] ✅ Add or update tests
- [ ] 🐛 Fix a bug
- [ ] 🏷️ Add or update types
- [ ] ⚡️ Improve performance
- [x] _Other(s):_ Moving code...
<!-- Don't forget to add the gitmoji icon in the name of the PR -->
<!-- See: https://gitmoji.dev/                                  -->

<!-- Fixing bugs, adding features... may impact existing ones           -->
<!-- in order to track potential issues that could be related to your PR -->
<!-- please check the impacts and describe more precisely what to expect -->

**_Potential impacts:_**

<!-- Generated values: Can your change impact any of the existing generators in terms of generated values, if so which ones? when? -->
<!-- Shrink values:    Can your change impact any of the existing generators in terms of shrink values, if so which ones? when? -->
<!-- Performance:      Can it require some typings changes on user side? Please give more details -->
<!-- Typings:          Is there a potential performance impact? In which cases? -->
- [ ] Generated values
- [ ] Shrink values
- [ ] Performance
- [ ] Typings
- [ ] _Other(s):_ ...


codesandbox[bot]: This pull request is automatically built and testable in [CodeSandbox](https://codesandbox.io).

  To see build info of the built libraries, click [here](https://ci.codesandbox.io/status/dubzzz/fast-check/pr/2085/builds/147629) or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8b8bd8c2c0de019986a3df29eb5e2b3538f7a4b5:

|Sandbox| Source |
|--|--|
|[Vanilla](https://codesandbox.io/s/vanilla-gypim)| Configuration |
|[fast-check-examples](https://codesandbox.io/s/fast-check-examples-qhrnf)| Configuration |

codecov[bot]: # [Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) Report
> Merging [#2085](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) (8b8bd8c) into [main](https://codecov.io/gh/dubzzz/fast-check/commit/1731bbcb2728abe763f02bb732f21016df9ea10a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) (1731bbc) will **increase** coverage by `0.02%`.
> The diff coverage is `98.07%`.

[![Impacted file tree graph](https://codecov.io/gh/dubzzz/fast-check/pull/2085/graphs/tree.svg?width=650&height=150&src=pr&token=fRi2fJN730&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN)](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN)

```diff
@@            Coverage Diff             @@
##             main    #2085      +/-   ##
==========================================
+ Coverage   96.46%   96.48%   +0.02%     
==========================================
  Files         178      187       +9     
  Lines        4413     4443      +30     
  Branches      875      875              
==========================================
+ Hits         4257     4287      +30     
  Misses        152      152              
  Partials        4        4              
```

| Flag | Coverage Δ | |
|---|---|---|
| unit-tests | `96.48% <98.07%> (+0.02%)` | :arrow_up: |
| unit-tests-12.x-Linux | `?` | |
| unit-tests-14.x-Linux | `96.48% <98.07%> (+0.02%)` | :arrow_up: |
| unit-tests-16.x-Linux | `?` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) | Coverage Δ | |
|---|---|---|
| [...trary/\_internals/helpers/JsonConstraintsBuilder.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL2hlbHBlcnMvSnNvbkNvbnN0cmFpbnRzQnVpbGRlci50cw==) | `76.92% <76.92%> (ø)` | |
| [...bitrary/\_internals/builders/AnyArbitraryBuilder.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL2J1aWxkZXJzL0FueUFyYml0cmFyeUJ1aWxkZXIudHM=) | `100.00% <100.00%> (ø)` | |
| [...trary/\_internals/builders/BoxedArbitraryBuilder.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL2J1aWxkZXJzL0JveGVkQXJiaXRyYXJ5QnVpbGRlci50cw==) | `100.00% <100.00%> (ø)` | |
| [...y/\_internals/helpers/QualifiedObjectConstraints.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL2hlbHBlcnMvUXVhbGlmaWVkT2JqZWN0Q29uc3RyYWludHMudHM=) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/anything.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9hbnl0aGluZy50cw==) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/json.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9qc29uLnRz) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/jsonObject.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9qc29uT2JqZWN0LnRz) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/object.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9vYmplY3QudHM=) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/unicodeJson.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS91bmljb2RlSnNvbi50cw==) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/unicodeJsonObject.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS91bmljb2RlSnNvbk9iamVjdC50cw==) | `100.00% <100.00%> (ø)` | |
| ... and [11 more](https://codecov.io/gh/dubzzz/fast-check/pull/2085/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN). Last update [1731bbc...8b8bd8c](https://codecov.io/gh/dubzzz/fast-check/pull/2085?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN).


Patch:
diff --git a/src/arbitrary/_internals/builders/AnyArbitraryBuilder.ts b/src/arbitrary/_internals/builders/AnyArbitraryBuilder.ts
new file mode 100644
index 00000000..e093a4c9
--- /dev/null
+++ b/src/arbitrary/_internals/builders/AnyArbitraryBuilder.ts
@@ -0,0 +1,107 @@
+import { Arbitrary } from '../../../check/arbitrary/definition/Arbitrary';
+
+import { stringify } from '../../../utils/stringify';
+import { array } from '../../array';
+import { frequency } from '../../frequency';
+import { memo, Memo } from '../../memo';
+import { oneof } from '../../oneof';
+import { set } from '../../set';
+import { tuple } from '../../tuple';
+import { bigInt } from '../../bigInt';
+import { date } from '../../date';
+import { float32Array } from '../../float32Array';
+import { float64Array } from '../../float64Array';
+import { int16Array } from '../../int16Array';
+import { int32Array } from '../../int32Array';
+import { int8Array } from '../../int8Array';
+import { uint16Array } from '../../uint16Array';
+import { uint32Array } from '../../uint32Array';
+import { uint8Array } from '../../uint8Array';
+import { uint8ClampedArray } from '../../uint8ClampedArray';
+import { sparseArray } from '../../sparseArray';
+import { keyValuePairsToObjectMapper } from '../mappers/KeyValuePairsToObject';
+import { QualifiedObjectConstraints } from '../helpers/QualifiedObjectConstraints';
+
+/** @internal */
+export function anyArbitraryBuilder(constraints: QualifiedObjectConstraints): Arbitrary<unknown> {
+  const arbKeys = constraints.withObjectString
+    ? memo((n) =>
+        frequency(
+          { arbitrary: constraints.key, weight: 10 },
+          // eslint-disable-next-line @typescript-eslint/no-use-before-define
+          { arbitrary: anythingArb(n).map((o) => stringify(o)), weight: 1 }
+        )
+      )
+    : memo(() => constraints.key);
+  const arbitrariesForBase = constraints.values;
+  const maxDepth = constraints.maxDepth;
+  const maxKeys = constraints.maxKeys;
+
+  const entriesOf = <T, U>(keyArb: Arbitrary<T>, valueArb: Arbitrary<U>) =>
+    set(tuple(keyArb, valueArb), { maxLength: maxKeys, compare: (t1, t2) => t1[0] === t2[0] });
+
+  const mapOf = <T, U>(ka: Arbitrary<T>, va: Arbitrary<U>) => entriesOf(ka, va).map((v) => new Map(v));
+  const dictOf = <U>(ka: Arbitrary<string>, va: Arbitrary<U>) =>
+    entriesOf(ka, va).map((v) => keyValuePairsToObjectMapper(v));
+
+  const baseArb = oneof(...arbitrariesForBase);
+  const arrayBaseArb = oneof(...arbitrariesForBase.map((arb) => array(arb, { maxLength: maxKeys })));
+  const objectBaseArb = (n: number) => oneof(...arbitrariesForBase.map((arb) => dictOf(arbKeys(n), arb)));
+  const setBaseArb = () =>
+    oneof(...arbitrariesForBase.map((arb) => set(arb, { maxLength: maxKeys }).map((v) => new Set(v))));
+  const mapBaseArb = (n: number) => oneof(...arbitrariesForBase.map((arb) => mapOf(arbKeys(n), arb)));
+
+  // base[] | anything[]
+  // eslint-disable-next-line @typescript-eslint/no-use-before-define
+  const arrayArb = memo((n) => oneof(arrayBaseArb, array(anythingArb(n), { maxLength: maxKeys })));
+  // Set<base> | Set<anything>
+  const setArb = memo((n) =>
+    oneof(
+      setBaseArb(),
+
+      // eslint-disable-next-line @typescript-eslint/no-use-before-define
+      set(anythingArb(n), { maxLength: maxKeys }).map((v) => new Set(v))
+    )
+  );
+  // Map<key, base> | (Map<key, anything> | Map<anything, anything>)
+  const mapArb = memo((n) =>
+    // eslint-disable-next-line @typescript-eslint/no-use-before-define
+    oneof(mapBaseArb(n), oneof(mapOf(arbKeys(n), anythingArb(n)), mapOf(anythingArb(n), anythingArb(n))))
+  );
+  // {[key:string]: base} | {[key:string]: anything}
+  // eslint-disable-next-line @typescript-eslint/no-use-before-define
+  const objectArb = memo((n) => oneof(objectBaseArb(n), dictOf(arbKeys(n), anythingArb(n))));
+
+  const anythingArb: Memo<unknown> = memo((n) => {
+    if (n <= 0) return oneof(baseArb);
+    return oneof(
+      baseArb,
+      arrayArb(),
+      objectArb(),
+      ...(constraints.withMap ? [mapArb()] : []),
+      ...(constraints.withSet ? [setArb()] : []),
+      ...(constraints.withObjectString ? [anythingArb().map((o) => stringify(o))] : []),
+      ...(constraints.withNullPrototype ? [objectArb().map((o) => Object.assign(Object.create(null), o))] : []),
+      ...(constraints.withBigInt ? [bigInt()] : []),
+      ...(constraints.withDate ? [date()] : []),
+      ...(constraints.withTypedArray
+        ? [
+            oneof(
+              int8Array(),
+              uint8Array(),
+              uint8ClampedArray(),
+              int16Array(),
+              uint16Array(),
+              int32Array(),
+              uint32Array(),
+              float32Array(),
+              float64Array()
+            ),
+          ]
+        : []),
+      ...(constraints.withSparseArray ? [sparseArray(anythingArb())] : [])
+    );
+  });
+
+  return anythingArb(maxDepth);
+}
diff --git a/src/arbitrary/_internals/builders/BoxedArbitraryBuilder.ts b/src/arbitrary/_internals/builders/BoxedArbitraryBuilder.ts
new file mode 100644
index 00000000..552e28f7
--- /dev/null
+++ b/src/arbitrary/_internals/builders/BoxedArbitraryBuilder.ts
@@ -0,0 +1,23 @@
+import { Arbitrary } from '../../../check/arbitrary/definition/Arbitrary';
+
+/** @internal */
+function toBoxedMapper(v: unknown): unknown {
+  switch (typeof v) {
+    case 'boolean':
+      // tslint:disable-next-line:no-construct
+      return new Boolean(v);
+    case 'number':
+      // tslint:disable-next-line:no-construct
+      return new Number(v);
+    case 'string':
+      // tslint:disable-next-line:no-construct
+      return new String(v);
+    default:
+      return v;
+  }
+}
+
+/** @internal */
+export function boxedArbitraryBuilder(arb: Arbitrary<unknown>): Arbitrary<unknown> {
+  return arb.map(toBoxedMapper);
+}
diff --git a/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts b/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts
new file mode 100644
index 00000000..0314ccf6
--- /dev/null
+++ b/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts
@@ -0,0 +1,48 @@
+import { Arbitrary } from '../../../check/arbitrary/definition/Arbitrary';
+import { boolean } from '../../boolean';
+import { constant } from '../../constant';
+import { double } from '../../../check/arbitrary/FloatingPointArbitrary';
+import { maxSafeInteger } from '../../maxSafeInteger';
+import { ObjectConstraints } from './QualifiedObjectConstraints';
+
+/**
+ * Shared constraints for:
+ * - {@link json},
+ * - {@link unicodeJson},
+ * - {@link jsonObject},
+ * - {@link unicodeJsonObject}
+ *
+ * @remarks Since 2.5.0
+ * @public
+ */
+export interface JsonSharedConstraints {
+  /**
+   * Maximal depth allowed
+   * @remarks Since 2.5.0
+   */
+  maxDepth?: number;
+}
+
+/**
+ * Derive `ObjectConstraints` from a `number | JsonSharedConstraints`
+ * @internal
+ */
+
+export function jsonConstraintsBuilder(
+  stringArbitrary: Arbitrary<string>,
+  constraints?: number | JsonSharedConstraints
+): ObjectConstraints {
+  const key = stringArbitrary;
+  const values = [
+    boolean(),
+    maxSafeInteger(),
+    double({ next: true, noDefaultInfinity: true, noNaN: true }),
+    stringArbitrary,
+    constant(null),
+  ];
+  return constraints != null
+    ? typeof constraints === 'number'
+      ? { key, values, maxDepth: constraints }
+      : { key, values, maxDepth: constraints.maxDepth }
+    : { key, values };
+}
diff --git a/src/arbitrary/_internals/helpers/QualifiedObjectConstraints.ts b/src/arbitrary/_internals/helpers/QualifiedObjectConstraints.ts
new file mode 100644
index 00000000..ba198c19
--- /dev/null
+++ b/src/arbitrary/_internals/helpers/QualifiedObjectConstraints.ts
@@ -0,0 +1,167 @@
+import { Arbitrary } from '../../../check/arbitrary/definition/Arbitrary';
+import { boolean } from '../../boolean';
+import { constant } from '../../constant';
+import { double } from '../../../check/arbitrary/FloatingPointArbitrary';
+import { maxSafeInteger } from '../../maxSafeInteger';
+import { oneof } from '../../oneof';
+import { string } from '../../string';
+import { boxedArbitraryBuilder } from '../builders/BoxedArbitraryBuilder';
+
+/**
+ * Constraints for {@link anything} and {@link object}
+ * @public
+ */
+export interface ObjectConstraints {
+  /**
+   * Maximal depth allowed
+   * @remarks Since 0.0.7
+   */
+  maxDepth?: number;
+  /**
+   * Maximal number of keys
+   * @remarks Since 1.13.0
+   */
+  maxKeys?: number;
+  /**
+   * Arbitrary for keys
+   *
+   * Default for `key` is: {@link string}
+   * @remarks Since 0.0.7
+   */
+  key?: Arbitrary<string>;
+  /**
+   * Arbitrary for values
+   *
+   * Default for `values` are:
+   * - {@link boolean},
+   * - {@link integer},
+   * - {@link double},
+   * - {@link string}
+   * - constants among:
+   *  - `null`,
+   *  - `undefined`,
+   *  - `Number.NaN`,
+   *  - `+0`,
+   *  - `-0`,
+   *  - `Number.EPSILON`,
+   *  - `Number.MIN_VALUE`,
+   *  - `Number.MAX_VALUE`,
+   *  - `Number.MIN_SAFE_INTEGER`,
+   *  - `Number.MAX_SAFE_INTEGER`,
+   *  - `Number.POSITIVE_INFINITY`,
+   *  - `Number.NEGATIVE_INFINITY`
+   * @remarks Since 0.0.7
+   */
+  values?: Arbitrary<unknown>[];
+  /**
+   * Also generate boxed versions of values
+   * @remarks Since 1.11.0
+   */
+  withBoxedValues?: boolean;
+  /**
+   * Also generate Set
+   * @remarks Since 1.11.0
+   */
+  withSet?: boolean;
+  /**
+   * Also generate Map
+   * @remarks Since 1.11.0
+   */
+  withMap?: boolean;
+  /**
+   * Also generate string representations of object instances
+   * @remarks Since 1.17.0
+   */
+  withObjectString?: boolean;
+  /**
+   * Also generate object with null prototype
+   * @remarks Since 1.23.0
+   */
+  withNullPrototype?: boolean;
+  /**
+   * Also generate BigInt
+   * @remarks Since 1.26.0
+   */
+  withBigInt?: boolean;
+  /**
+   * Also generate Date
+   * @remarks Since 2.5.0
+   */
+  withDate?: boolean;
+  /**
+   * Also generate typed arrays in: (Uint|Int)(8|16|32)Array and Float(32|64)Array
+   * Remark: no typed arrays made of bigint
+   * @remarks Since 2.9.0
+   */
+  withTypedArray?: boolean;
+  /**
+   * Also generate sparse arrays (arrays with holes)
+   * @remarks Since 2.13.0
+   */
+  withSparseArray?: boolean;
+}
+
+/**
+ * Internal wrapper around an `ObjectConstraints`, it adds all the missing pieces in the configuration
+ * @internal
+ */
+export class QualifiedObjectConstraints {
+  constructor(
+    readonly key: Arbitrary<string>,
+    readonly values: Arbitrary<unknown>[],
+    readonly maxDepth: number,
+    readonly maxKeys: number,
+    readonly withSet: boolean,
+    readonly withMap: boolean,
+    readonly withObjectString: boolean,
+    readonly withNullPrototype: boolean,
+    readonly withBigInt: boolean,
+    readonly withDate: boolean,
+    readonly withTypedArray: boolean,
+    readonly withSparseArray: boolean
+  ) {}
+
+  /**
+   * Default value of ObjectConstraints.values field
+   */
+  static defaultValues(): Arbitrary<unknown>[] {
+    return [
+      boolean(),
+      maxSafeInteger(),
+      double({ next: true }),
+      string(),
+      oneof(string(), constant(null), constant(undefined)),
+    ];
+  }
+
+  private static boxArbitraries(arbs: Arbitrary<unknown>[]): Arbitrary<unknown>[] {
+    return arbs.map((arb) => boxedArbitraryBuilder(arb));
+  }
+
+  private static boxArbitrariesIfNeeded(arbs: Arbitrary<unknown>[], boxEnabled: boolean): Arbitrary<unknown>[] {
+    return boxEnabled ? QualifiedObjectConstraints.boxArbitraries(arbs).concat(arbs) : arbs;
+  }
+
+  static from(settings: ObjectConstraints = {}): QualifiedObjectConstraints {
+    function orDefault<T>(optionalValue: T | undefined, defaultValue: T): T {
+      return optionalValue !== undefined ? optionalValue : defaultValue;
+    }
+    return new QualifiedObjectConstraints(
+      orDefault(settings.key, string()),
+      QualifiedObjectConstraints.boxArbitrariesIfNeeded(
+        orDefault(settings.values, QualifiedObjectConstraints.defaultValues()),
+        orDefault(settings.withBoxedValues, false)
+      ),
+      orDefault(settings.maxDepth, 2),
+      orDefault(settings.maxKeys, 5),
+      orDefault(settings.withSet, false),
+      orDefault(settings.withMap, false),
+      orDefault(settings.withObjectString, false),
+      orDefault(settings.withNullPrototype, false),
+      orDefault(settings.withBigInt, false),
+      orDefault(settings.withDate, false),
+      orDefault(settings.withTypedArray, false),
+      orDefault(settings.withSparseArray, false)
+    );
+  }
+}
diff --git a/src/arbitrary/anything.ts b/src/arbitrary/anything.ts
new file mode 100644
index 00000000..d8b355af
--- /dev/null
+++ b/src/arbitrary/anything.ts
@@ -0,0 +1,55 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { anyArbitraryBuilder } from './_internals/builders/AnyArbitraryBuilder';
+import { QualifiedObjectConstraints, ObjectConstraints } from './_internals/helpers/QualifiedObjectConstraints';
+
+export { ObjectConstraints };
+
+/**
+ * For any type of values
+ *
+ * You may use {@link sample} to preview the values that will be generated
+ *
+ * @example
+ * ```javascript
+ * null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
+ * ```
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function anything(): Arbitrary<unknown>;
+/**
+ * For any type of values following the constraints defined by `settings`
+ *
+ * You may use {@link sample} to preview the values that will be generated
+ *
+ * @example
+ * ```javascript
+ * null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
+ * ```
+ *
+ * @example
+ * ```typescript
+ * // Using custom settings
+ * fc.anything({
+ *     key: fc.char(),
+ *     values: [fc.integer(10,20), fc.constant(42)],
+ *     maxDepth: 2
+ * });
+ * // Can build entries such as:
+ * // - 19
+ * // - [{"2":12,"k":15,"A":42}]
+ * // - {"4":[19,13,14,14,42,11,20,11],"6":42,"7":16,"L":10,"'":[20,11],"e":[42,20,42,14,13,17]}
+ * // - [42,42,42]...
+ * ```
+ *
+ * @param constraints - Constraints to apply when building instances
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function anything(constraints: ObjectConstraints): Arbitrary<unknown>;
+function anything(constraints?: ObjectConstraints): Arbitrary<unknown> {
+  return anyArbitraryBuilder(QualifiedObjectConstraints.from(constraints));
+}
+export { anything };
diff --git a/src/arbitrary/json.ts b/src/arbitrary/json.ts
new file mode 100644
index 00000000..1542bf6e
--- /dev/null
+++ b/src/arbitrary/json.ts
@@ -0,0 +1,48 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { jsonObject } from './jsonObject';
+import { JsonSharedConstraints } from './_internals/helpers/JsonConstraintsBuilder';
+
+export { JsonSharedConstraints };
+
+/**
+ * For any JSON strings
+ *
+ * Keys and string values rely on {@link string}
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function json(): Arbitrary<string>;
+/**
+ * For any JSON strings with a maximal depth
+ *
+ * Keys and string values rely on {@link string}
+ *
+ * @param maxDepth - Maximal depth of the generated objects
+ *
+ * @deprecated
+ * Superceded by `fc.json({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
+ * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function json(maxDepth: number): Arbitrary<string>;
+/**
+ * For any JSON strings
+ *
+ * Keys and string values rely on {@link string}
+ *
+ * @param constraints - Constraints to be applied onto the generated instance
+ *
+ * @remarks Since 2.5.0
+ * @public
+ */
+function json(constraints: JsonSharedConstraints): Arbitrary<unknown>;
+function json(constraints?: number | JsonSharedConstraints): Arbitrary<string> {
+  // Rq: Explicit 'as any' as 'number | JsonConstraints' cannot be passed to 'unicodeJsonObject(number)'
+  //     and cannot be passed to 'unicodeJsonObject(JsonConstraints)' (both are too strict)
+  const arb = constraints != null ? jsonObject(constraints as any) : jsonObject();
+  return arb.map(JSON.stringify);
+}
+export { json };
diff --git a/src/arbitrary/jsonObject.ts b/src/arbitrary/jsonObject.ts
new file mode 100644
index 00000000..0cf664cc
--- /dev/null
+++ b/src/arbitrary/jsonObject.ts
@@ -0,0 +1,46 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { string } from './string';
+import { jsonConstraintsBuilder, JsonSharedConstraints } from './_internals/helpers/JsonConstraintsBuilder';
+import { anything } from './anything';
+
+export { JsonSharedConstraints };
+
+/**
+ * For any JSON compliant values
+ *
+ * Keys and string values rely on {@link string}
+ *
+ * @remarks Since 1.2.3
+ * @public
+ */
+function jsonObject(): Arbitrary<unknown>;
+/**
+ * For any JSON compliant values with a maximal depth
+ *
+ * Keys and string values rely on {@link string}
+ *
+ * @param maxDepth - Maximal depth of the generated values
+ *
+ * @deprecated
+ * Superceded by `fc.jsonObject({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
+ * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
+ *
+ * @remarks Since 1.2.3
+ * @public
+ */
+function jsonObject(maxDepth: number): Arbitrary<unknown>;
+/**
+ * For any JSON compliant values
+ *
+ * Keys and string values rely on {@link string}
+ *
+ * @param constraints - Constraints to be applied onto the generated instance
+ *
+ * @remarks Since 2.5.0
+ * @public
+ */
+function jsonObject(constraints: JsonSharedConstraints): Arbitrary<unknown>;
+function jsonObject(constraints?: number | JsonSharedConstraints): Arbitrary<unknown> {
+  return anything(jsonConstraintsBuilder(string(), constraints));
+}
+export { jsonObject };
diff --git a/src/arbitrary/object.ts b/src/arbitrary/object.ts
new file mode 100644
index 00000000..8ff9c036
--- /dev/null
+++ b/src/arbitrary/object.ts
@@ -0,0 +1,46 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { dictionary } from './dictionary';
+import { anyArbitraryBuilder } from './_internals/builders/AnyArbitraryBuilder';
+import { QualifiedObjectConstraints, ObjectConstraints } from './_internals/helpers/QualifiedObjectConstraints';
+
+export { ObjectConstraints };
+
+/** @internal */
+function objectInternal(constraints: QualifiedObjectConstraints): Arbitrary<Record<string, unknown>> {
+  return dictionary(constraints.key, anyArbitraryBuilder(constraints));
+}
+
+/**
+ * For any objects
+ *
+ * You may use {@link sample} to preview the values that will be generated
+ *
+ * @example
+ * ```javascript
+ * {}, {k: [{}, 1, 2]}
+ * ```
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function object(): Arbitrary<Record<string, unknown>>;
+/**
+ * For any objects following the constraints defined by `settings`
+ *
+ * You may use {@link sample} to preview the values that will be generated
+ *
+ * @example
+ * ```javascript
+ * {}, {k: [{}, 1, 2]}
+ * ```
+ *
+ * @param constraints - Constraints to apply when building instances
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function object(constraints: ObjectConstraints): Arbitrary<Record<string, unknown>>;
+function object(constraints?: ObjectConstraints): Arbitrary<Record<string, unknown>> {
+  return objectInternal(QualifiedObjectConstraints.from(constraints));
+}
+export { object };
diff --git a/src/arbitrary/unicodeJson.ts b/src/arbitrary/unicodeJson.ts
new file mode 100644
index 00000000..b143dd13
--- /dev/null
+++ b/src/arbitrary/unicodeJson.ts
@@ -0,0 +1,48 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { unicodeJsonObject } from './unicodeJsonObject';
+import { JsonSharedConstraints } from './_internals/helpers/JsonConstraintsBuilder';
+
+export { JsonSharedConstraints };
+
+/**
+ * For any JSON strings with unicode support
+ *
+ * Keys and string values rely on {@link unicode}
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function unicodeJson(): Arbitrary<string>;
+/**
+ * For any JSON strings with unicode support and a maximal depth
+ *
+ * Keys and string values rely on {@link unicode}
+ *
+ * @param maxDepth - Maximal depth of the generated objects
+ *
+ * @deprecated
+ * Superceded by `fc.unicodeJson({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
+ * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function unicodeJson(maxDepth: number): Arbitrary<string>;
+/**
+ * For any JSON strings with unicode support
+ *
+ * Keys and string values rely on {@link unicode}
+ *
+ * @param constraints - Constraints to be applied onto the generated instance
+ *
+ * @remarks Since 2.5.0
+ * @public
+ */
+function unicodeJson(constraints: JsonSharedConstraints): Arbitrary<unknown>;
+function unicodeJson(constraints?: number | JsonSharedConstraints): Arbitrary<string> {
+  // Rq: Explicit 'as any' as 'number | JsonConstraints' cannot be passed to 'unicodeJsonObject(number)'
+  //     and cannot be passed to 'unicodeJsonObject(JsonConstraints)' (both are too strict)
+  const arb = constraints != null ? unicodeJsonObject(constraints as any) : unicodeJsonObject();
+  return arb.map(JSON.stringify);
+}
+export { unicodeJson };
diff --git a/src/arbitrary/unicodeJsonObject.ts b/src/arbitrary/unicodeJsonObject.ts
new file mode 100644
index 00000000..883299df
--- /dev/null
+++ b/src/arbitrary/unicodeJsonObject.ts
@@ -0,0 +1,46 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { unicodeString } from './unicodeString';
+import { jsonConstraintsBuilder, JsonSharedConstraints } from './_internals/helpers/JsonConstraintsBuilder';
+import { anything } from './anything';
+
+export { JsonSharedConstraints };
+
+/**
+ * For any JSON compliant values with unicode support
+ *
+ * Keys and string values rely on {@link unicode}
+ *
+ * @remarks Since 1.2.3
+ * @public
+ */
+function unicodeJsonObject(): Arbitrary<unknown>;
+/**
+ * For any JSON compliant values with unicode support and a maximal depth
+ *
+ * Keys and string values rely on {@link unicode}
+ *
+ * @param maxDepth - Maximal depth of the generated values
+ *
+ * @deprecated
+ * Superceded by `fc.unicodeJsonObject({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
+ * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
+ *
+ * @remarks Since 1.2.3
+ * @public
+ */
+function unicodeJsonObject(maxDepth: number): Arbitrary<unknown>;
+/**
+ * For any JSON compliant values with unicode support
+ *
+ * Keys and string values rely on {@link unicode}
+ *
+ * @param constraints - Constraints to be applied onto the generated instance
+ *
+ * @remarks Since 2.5.0
+ * @public
+ */
+function unicodeJsonObject(constraints: JsonSharedConstraints): Arbitrary<unknown>;
+function unicodeJsonObject(constraints?: number | JsonSharedConstraints): Arbitrary<unknown> {
+  return anything(jsonConstraintsBuilder(unicodeString(), constraints));
+}
+export { unicodeJsonObject };
diff --git a/src/check/arbitrary/ObjectArbitrary.ts b/src/check/arbitrary/ObjectArbitrary.ts
deleted file mode 100644
index 90515bc9..00000000
--- a/src/check/arbitrary/ObjectArbitrary.ts
+++ /dev/null
@@ -1,575 +0,0 @@
-import { Arbitrary } from './definition/Arbitrary';
-
-import { stringify } from '../../utils/stringify';
-import { array } from '../../arbitrary/array';
-import { boolean } from '../../arbitrary/boolean';
-import { constant } from '../../arbitrary/constant';
-import { dictionary } from '../../arbitrary/dictionary';
-import { double } from './FloatingPointArbitrary';
-import { frequency } from '../../arbitrary/frequency';
-import { maxSafeInteger } from '../../arbitrary/maxSafeInteger';
-import { memo, Memo } from '../../arbitrary/memo';
-import { oneof } from '../../arbitrary/oneof';
-import { set } from '../../arbitrary/set';
-import { string } from '../../arbitrary/string';
-import { unicodeString } from '../../arbitrary/unicodeString';
-import { tuple } from '../../arbitrary/tuple';
-import { bigInt } from '../../arbitrary/bigInt';
-import { date } from '../../arbitrary/date';
-import { float32Array } from '../../arbitrary/float32Array';
-import { float64Array } from '../../arbitrary/float64Array';
-import { int16Array } from '../../arbitrary/int16Array';
-import { int32Array } from '../../arbitrary/int32Array';
-import { int8Array } from '../../arbitrary/int8Array';
-import { uint16Array } from '../../arbitrary/uint16Array';
-import { uint32Array } from '../../arbitrary/uint32Array';
-import { uint8Array } from '../../arbitrary/uint8Array';
-import { uint8ClampedArray } from '../../arbitrary/uint8ClampedArray';
-import { sparseArray } from '../../arbitrary/sparseArray';
-import { keyValuePairsToObjectMapper } from '../../arbitrary/_internals/mappers/KeyValuePairsToObject';
-
-/**
- * Constraints for {@link anything} and {@link object}
- * @public
- */
-export interface ObjectConstraints {
-  /**
-   * Maximal depth allowed
-   * @remarks Since 0.0.7
-   */
-  maxDepth?: number;
-  /**
-   * Maximal number of keys
-   * @remarks Since 1.13.0
-   */
-  maxKeys?: number;
-  /**
-   * Arbitrary for keys
-   *
-   * Default for `key` is: {@link string}
-   * @remarks Since 0.0.7
-   */
-  key?: Arbitrary<string>;
-  /**
-   * Arbitrary for values
-   *
-   * Default for `values` are:
-   * - {@link boolean},
-   * - {@link integer},
-   * - {@link double},
-   * - {@link string}
-   * - constants among:
-   *  - `null`,
-   *  - `undefined`,
-   *  - `Number.NaN`,
-   *  - `+0`,
-   *  - `-0`,
-   *  - `Number.EPSILON`,
-   *  - `Number.MIN_VALUE`,
-   *  - `Number.MAX_VALUE`,
-   *  - `Number.MIN_SAFE_INTEGER`,
-   *  - `Number.MAX_SAFE_INTEGER`,
-   *  - `Number.POSITIVE_INFINITY`,
-   *  - `Number.NEGATIVE_INFINITY`
-   * @remarks Since 0.0.7
-   */
-  values?: Arbitrary<unknown>[];
-  /**
-   * Also generate boxed versions of values
-   * @remarks Since 1.11.0
-   */
-  withBoxedValues?: boolean;
-  /**
-   * Also generate Set
-   * @remarks Since 1.11.0
-   */
-  withSet?: boolean;
-  /**
-   * Also generate Map
-   * @remarks Since 1.11.0
-   */
-  withMap?: boolean;
-  /**
-   * Also generate string representations of object instances
-   * @remarks Since 1.17.0
-   */
-  withObjectString?: boolean;
-  /**
-   * Also generate object with null prototype
-   * @remarks Since 1.23.0
-   */
-  withNullPrototype?: boolean;
-  /**
-   * Also generate BigInt
-   * @remarks Since 1.26.0
-   */
-  withBigInt?: boolean;
-  /**
-   * Also generate Date
-   * @remarks Since 2.5.0
-   */
-  withDate?: boolean;
-  /**
-   * Also generate typed arrays in: (Uint|Int)(8|16|32)Array and Float(32|64)Array
-   * Remark: no typed arrays made of bigint
-   * @remarks Since 2.9.0
-   */
-  withTypedArray?: boolean;
-  /**
-   * Also generate sparse arrays (arrays with holes)
-   * @remarks Since 2.13.0
-   */
-  withSparseArray?: boolean;
-}
-
-/**
- * Shared constraints for:
- * - {@link json},
- * - {@link unicodeJson},
- * - {@link jsonObject},
- * - {@link unicodeJsonObject}
- *
- * @remarks Since 2.5.0
- * @public
- */
-export interface JsonSharedConstraints {
-  /**
-   * Maximal depth allowed
-   * @remarks Since 2.5.0
-   */
-  maxDepth?: number;
-}
-
-/** @internal */
-export function boxArbitrary(arb: Arbitrary<unknown>): Arbitrary<unknown> {
-  return arb.map((v) => {
-    switch (typeof v) {
-      case 'boolean':
-        // tslint:disable-next-line:no-construct
-        return new Boolean(v);
-      case 'number':
-        // tslint:disable-next-line:no-construct
-        return new Number(v);
-      case 'string':
-        // tslint:disable-next-line:no-construct
-        return new String(v);
-      default:
-        return v;
-    }
-  });
-}
-
-/** @internal */
-class QualifiedObjectConstraints {
-  constructor(
-    readonly key: Arbitrary<string>,
-    readonly values: Arbitrary<unknown>[],
-    readonly maxDepth: number,
-    readonly maxKeys: number,
-    readonly withSet: boolean,
-    readonly withMap: boolean,
-    readonly withObjectString: boolean,
-    readonly withNullPrototype: boolean,
-    readonly withBigInt: boolean,
-    readonly withDate: boolean,
-    readonly withTypedArray: boolean,
-    readonly withSparseArray: boolean
-  ) {}
-
-  /**
-   * Default value of ObjectConstraints.values field
-   */
-  static defaultValues(): Arbitrary<unknown>[] {
-    return [
-      boolean(),
-      maxSafeInteger(), // includes: 0, MIN_SAFE_INTEGER, MAX_SAFE_INTEGER
-      double({ next: true }), // includes: -/+0, -/+inf, -/+MIN_VALUE, -/+MAX_VALUE, NaN
-      string(),
-      oneof(string(), constant(null), constant(undefined)),
-    ];
-  }
-
-  private static boxArbitraries(arbs: Arbitrary<unknown>[]): Arbitrary<unknown>[] {
-    return arbs.map((arb) => boxArbitrary(arb));
-  }
-
-  private static boxArbitrariesIfNeeded(arbs: Arbitrary<unknown>[], boxEnabled: boolean): Arbitrary<unknown>[] {
-    return boxEnabled ? QualifiedObjectConstraints.boxArbitraries(arbs).concat(arbs) : arbs;
-  }
-
-  static from(settings: ObjectConstraints = {}): QualifiedObjectConstraints {
-    function orDefault<T>(optionalValue: T | undefined, defaultValue: T): T {
-      return optionalValue !== undefined ? optionalValue : defaultValue;
-    }
-    return new QualifiedObjectConstraints(
-      orDefault(settings.key, string()),
-      QualifiedObjectConstraints.boxArbitrariesIfNeeded(
-        orDefault(settings.values, QualifiedObjectConstraints.defaultValues()),
-        orDefault(settings.withBoxedValues, false)
-      ),
-      orDefault(settings.maxDepth, 2),
-      orDefault(settings.maxKeys, 5),
-      orDefault(settings.withSet, false),
-      orDefault(settings.withMap, false),
-      orDefault(settings.withObjectString, false),
-      orDefault(settings.withNullPrototype, false),
-      orDefault(settings.withBigInt, false),
-      orDefault(settings.withDate, false),
-      orDefault(settings.withTypedArray, false),
-      orDefault(settings.withSparseArray, false)
-    );
-  }
-}
-
-/** @internal */
-const anythingInternal = (constraints: QualifiedObjectConstraints): Arbitrary<unknown> => {
-  const arbKeys = constraints.withObjectString
-    ? memo((n) =>
-        frequency(
-          { arbitrary: constraints.key, weight: 10 },
-          // eslint-disable-next-line @typescript-eslint/no-use-before-define
-          { arbitrary: anythingArb(n).map((o) => stringify(o)), weight: 1 }
-        )
-      )
-    : memo(() => constraints.key);
-  const arbitrariesForBase = constraints.values;
-  const maxDepth = constraints.maxDepth;
-  const maxKeys = constraints.maxKeys;
-
-  const entriesOf = <T, U>(keyArb: Arbitrary<T>, valueArb: Arbitrary<U>) =>
-    set(tuple(keyArb, valueArb), { maxLength: maxKeys, compare: (t1, t2) => t1[0] === t2[0] });
-
-  const mapOf = <T, U>(ka: Arbitrary<T>, va: Arbitrary<U>) => entriesOf(ka, va).map((v) => new Map(v));
-  const dictOf = <U>(ka: Arbitrary<string>, va: Arbitrary<U>) =>
-    entriesOf(ka, va).map((v) => keyValuePairsToObjectMapper(v));
-
-  const baseArb = oneof(...arbitrariesForBase);
-  const arrayBaseArb = oneof(...arbitrariesForBase.map((arb) => array(arb, { maxLength: maxKeys })));
-  const objectBaseArb = (n: number) => oneof(...arbitrariesForBase.map((arb) => dictOf(arbKeys(n), arb)));
-  const setBaseArb = () =>
-    oneof(...arbitrariesForBase.map((arb) => set(arb, { maxLength: maxKeys }).map((v) => new Set(v))));
-  const mapBaseArb = (n: number) => oneof(...arbitrariesForBase.map((arb) => mapOf(arbKeys(n), arb)));
-
-  // base[] | anything[]
-  // eslint-disable-next-line @typescript-eslint/no-use-before-define
-  const arrayArb = memo((n) => oneof(arrayBaseArb, array(anythingArb(n), { maxLength: maxKeys })));
-  // Set<base> | Set<anything>
-  const setArb = memo((n) =>
-    oneof(
-      setBaseArb(),
-
-      // eslint-disable-next-line @typescript-eslint/no-use-before-define
-      set(anythingArb(n), { maxLength: maxKeys }).map((v) => new Set(v))
-    )
-  );
-  // Map<key, base> | (Map<key, anything> | Map<anything, anything>)
-  const mapArb = memo((n) =>
-    // eslint-disable-next-line @typescript-eslint/no-use-before-define
-    oneof(mapBaseArb(n), oneof(mapOf(arbKeys(n), anythingArb(n)), mapOf(anythingArb(n), anythingArb(n))))
-  );
-  // {[key:string]: base} | {[key:string]: anything}
-  // eslint-disable-next-line @typescript-eslint/no-use-before-define
-  const objectArb = memo((n) => oneof(objectBaseArb(n), dictOf(arbKeys(n), anythingArb(n))));
-
-  const anythingArb: Memo<unknown> = memo((n) => {
-    if (n <= 0) return oneof(baseArb);
-    return oneof(
-      baseArb,
-      arrayArb(),
-      objectArb(),
-      ...(constraints.withMap ? [mapArb()] : []),
-      ...(constraints.withSet ? [setArb()] : []),
-      ...(constraints.withObjectString ? [anythingArb().map((o) => stringify(o))] : []),
-      ...(constraints.withNullPrototype ? [objectArb().map((o) => Object.assign(Object.create(null), o))] : []),
-      ...(constraints.withBigInt ? [bigInt()] : []),
-      ...(constraints.withDate ? [date()] : []),
-      ...(constraints.withTypedArray
-        ? [
-            oneof(
-              int8Array(),
-              uint8Array(),
-              uint8ClampedArray(),
-              int16Array(),
-              uint16Array(),
-              int32Array(),
-              uint32Array(),
-              float32Array(),
-              float64Array()
-            ),
-          ]
-        : []),
-      ...(constraints.withSparseArray ? [sparseArray(anythingArb())] : [])
-    );
-  });
-
-  return anythingArb(maxDepth);
-};
-
-/** @internal */
-const objectInternal = (constraints: QualifiedObjectConstraints): Arbitrary<Record<string, unknown>> => {
-  return dictionary(constraints.key, anythingInternal(constraints));
-};
-
-/**
- * For any type of values
- *
- * You may use {@link sample} to preview the values that will be generated
- *
- * @example
- * ```javascript
- * null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
- * ```
- *
- * @remarks Since 0.0.7
- * @public
- */
-function anything(): Arbitrary<unknown>;
-/**
- * For any type of values following the constraints defined by `settings`
- *
- * You may use {@link sample} to preview the values that will be generated
- *
- * @example
- * ```javascript
- * null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
- * ```
- *
- * @example
- * ```typescript
- * // Using custom settings
- * fc.anything({
- *     key: fc.char(),
- *     values: [fc.integer(10,20), fc.constant(42)],
- *     maxDepth: 2
- * });
- * // Can build entries such as:
- * // - 19
- * // - [{"2":12,"k":15,"A":42}]
- * // - {"4":[19,13,14,14,42,11,20,11],"6":42,"7":16,"L":10,"'":[20,11],"e":[42,20,42,14,13,17]}
- * // - [42,42,42]...
- * ```
- *
- * @param constraints - Constraints to apply when building instances
- *
- * @remarks Since 0.0.7
- * @public
- */
-function anything(constraints: ObjectConstraints): Arbitrary<unknown>;
-function anything(constraints?: ObjectConstraints): Arbitrary<unknown> {
-  return anythingInternal(QualifiedObjectConstraints.from(constraints));
-}
-
-/**
- * For any objects
- *
- * You may use {@link sample} to preview the values that will be generated
- *
- * @example
- * ```javascript
- * {}, {k: [{}, 1, 2]}
- * ```
- *
- * @remarks Since 0.0.7
- * @public
- */
-function object(): Arbitrary<Record<string, unknown>>;
-/**
- * For any objects following the constraints defined by `settings`
- *
- * You may use {@link sample} to preview the values that will be generated
- *
- * @example
- * ```javascript
- * {}, {k: [{}, 1, 2]}
- * ```
- *
- * @param constraints - Constraints to apply when building instances
- *
- * @remarks Since 0.0.7
- * @public
- */
-function object(constraints: ObjectConstraints): Arbitrary<Record<string, unknown>>;
-function object(constraints?: ObjectConstraints): Arbitrary<Record<string, unknown>> {
-  return objectInternal(QualifiedObjectConstraints.from(constraints));
-}
-
-/** @internal */
-function jsonSettings(stringArbitrary: Arbitrary<string>, constraints?: number | JsonSharedConstraints) {
-  const key = stringArbitrary;
-  const values = [
-    boolean(),
-    maxSafeInteger(),
-    double({ next: true, noDefaultInfinity: true, noNaN: true }),
-    stringArbitrary,
-    constant(null),
-  ];
-  return constraints != null
-    ? typeof constraints === 'number'
-      ? { key, values, maxDepth: constraints }
-      : { key, values, maxDepth: constraints.maxDepth }
-    : { key, values };
-}
-
-/**
- * For any JSON compliant values
- *
- * Keys and string values rely on {@link string}
- *
- * @remarks Since 1.2.3
- * @public
- */
-function jsonObject(): Arbitrary<unknown>;
-/**
- * For any JSON compliant values with a maximal depth
- *
- * Keys and string values rely on {@link string}
- *
- * @param maxDepth - Maximal depth of the generated values
- *
- * @deprecated
- * Superceded by `fc.jsonObject({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
- * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
- *
- * @remarks Since 1.2.3
- * @public
- */
-function jsonObject(maxDepth: number): Arbitrary<unknown>;
-/**
- * For any JSON compliant values
- *
- * Keys and string values rely on {@link string}
- *
- * @param constraints - Constraints to be applied onto the generated instance
- *
- * @remarks Since 2.5.0
- * @public
- */
-function jsonObject(constraints: JsonSharedConstraints): Arbitrary<unknown>;
-function jsonObject(constraints?: number | JsonSharedConstraints): Arbitrary<unknown> {
-  return anything(jsonSettings(string(), constraints));
-}
-
-/**
- * For any JSON compliant values with unicode support
- *
- * Keys and string values rely on {@link unicode}
- *
- * @remarks Since 1.2.3
- * @public
- */
-function unicodeJsonObject(): Arbitrary<unknown>;
-/**
- * For any JSON compliant values with unicode support and a maximal depth
- *
- * Keys and string values rely on {@link unicode}
- *
- * @param maxDepth - Maximal depth of the generated values
- *
- * @deprecated
- * Superceded by `fc.unicodeJsonObject({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
- * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
- *
- * @remarks Since 1.2.3
- * @public
- */
-function unicodeJsonObject(maxDepth: number): Arbitrary<unknown>;
-/**
- * For any JSON compliant values with unicode support
- *
- * Keys and string values rely on {@link unicode}
- *
- * @param constraints - Constraints to be applied onto the generated instance
- *
- * @remarks Since 2.5.0
- * @public
- */
-function unicodeJsonObject(constraints: JsonSharedConstraints): Arbitrary<unknown>;
-function unicodeJsonObject(constraints?: number | JsonSharedConstraints): Arbitrary<unknown> {
-  return anything(jsonSettings(unicodeString(), constraints));
-}
-
-/**
- * For any JSON strings
- *
- * Keys and string values rely on {@link string}
- *
- * @remarks Since 0.0.7
- * @public
- */
-function json(): Arbitrary<string>;
-/**
- * For any JSON strings with a maximal depth
- *
- * Keys and string values rely on {@link string}
- *
- * @param maxDepth - Maximal depth of the generated objects
- *
- * @deprecated
- * Superceded by `fc.json({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
- * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
- *
- * @remarks Since 0.0.7
- * @public
- */
-function json(maxDepth: number): Arbitrary<string>;
-/**
- * For any JSON strings
- *
- * Keys and string values rely on {@link string}
- *
- * @param constraints - Constraints to be applied onto the generated instance
- *
- * @remarks Since 2.5.0
- * @public
- */
-function json(constraints: JsonSharedConstraints): Arbitrary<unknown>;
-function json(constraints?: number | JsonSharedConstraints): Arbitrary<string> {
-  // Rq: Explicit 'as any' as 'number | JsonConstraints' cannot be passed to 'unicodeJsonObject(number)'
-  //     and cannot be passed to 'unicodeJsonObject(JsonConstraints)' (both are too strict)
-  const arb = constraints != null ? jsonObject(constraints as any) : jsonObject();
-  return arb.map(JSON.stringify);
-}
-
-/**
- * For any JSON strings with unicode support
- *
- * Keys and string values rely on {@link unicode}
- *
- * @remarks Since 0.0.7
- * @public
- */
-function unicodeJson(): Arbitrary<string>;
-/**
- * For any JSON strings with unicode support and a maximal depth
- *
- * Keys and string values rely on {@link unicode}
- *
- * @param maxDepth - Maximal depth of the generated objects
- *
- * @deprecated
- * Superceded by `fc.unicodeJson({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
- * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
- *
- * @remarks Since 0.0.7
- * @public
- */
-function unicodeJson(maxDepth: number): Arbitrary<string>;
-/**
- * For any JSON strings with unicode support
- *
- * Keys and string values rely on {@link unicode}
- *
- * @param constraints - Constraints to be applied onto the generated instance
- *
- * @remarks Since 2.5.0
- * @public
- */
-function unicodeJson(constraints: JsonSharedConstraints): Arbitrary<unknown>;
-function unicodeJson(constraints?: number | JsonSharedConstraints): Arbitrary<string> {
-  // Rq: Explicit 'as any' as 'number | JsonConstraints' cannot be passed to 'unicodeJsonObject(number)'
-  //     and cannot be passed to 'unicodeJsonObject(JsonConstraints)' (both are too strict)
-  const arb = constraints != null ? unicodeJsonObject(constraints as any) : unicodeJsonObject();
-  return arb.map(JSON.stringify);
-}
-
-export { anything, object, jsonObject, unicodeJsonObject, json, unicodeJson };
diff --git a/src/fast-check-default.ts b/src/fast-check-default.ts
index 64ccb72e..3d48da48 100644
--- a/src/fast-check-default.ts
+++ b/src/fast-check-default.ts
@@ -62,16 +62,12 @@ import { lorem, LoremConstraints } from './arbitrary/lorem';
 import { mapToConstant } from './arbitrary/mapToConstant';
 import { memo, Memo } from './arbitrary/memo';
 import { mixedCase, MixedCaseConstraints } from './arbitrary/mixedCase';
-import {
-  anything,
-  json,
-  JsonSharedConstraints,
-  jsonObject,
-  object,
-  ObjectConstraints,
-  unicodeJson,
-  unicodeJsonObject,
-} from './check/arbitrary/ObjectArbitrary';
+import { object, ObjectConstraints } from './arbitrary/object';
+import { json, JsonSharedConstraints } from './arbitrary/json';
+import { anything } from './arbitrary/anything';
+import { unicodeJsonObject } from './arbitrary/unicodeJsonObject';
+import { jsonObject } from './arbitrary/jsonObject';
+import { unicodeJson } from './arbitrary/unicodeJson';
 import { oneof, OneOfValue, OneOfConstraints } from './arbitrary/oneof';
 import { option, OptionConstraints } from './arbitrary/option';
 import { record, RecordConstraints, RecordValue } from './arbitrary/record';


Test patch:
diff --git a/test/unit/check/arbitrary/ObjectArbitrary.spec.ts b/test/unit/arbitrary/ObjectArbitrary.spec.ts
similarity index 95%
rename from test/unit/check/arbitrary/ObjectArbitrary.spec.ts
rename to test/unit/arbitrary/ObjectArbitrary.spec.ts
index 291b7468..2b093e8f 100644
--- a/test/unit/check/arbitrary/ObjectArbitrary.spec.ts
+++ b/test/unit/arbitrary/ObjectArbitrary.spec.ts
@@ -1,22 +1,19 @@
 import * as prand from 'pure-rand';
-import * as fc from '../../../../lib/fast-check';
+import * as fc from '../../../lib/fast-check';
 
-import { constant } from '../../../../src/arbitrary/constant';
-import { oneof } from '../../../../src/arbitrary/oneof';
-import {
-  anything,
-  object,
-  jsonObject,
-  unicodeJsonObject,
-  json,
-  unicodeJson,
-  ObjectConstraints,
-  boxArbitrary,
-} from '../../../../src/check/arbitrary/ObjectArbitrary';
+import { constant } from '../../../src/arbitrary/constant';
+import { oneof } from '../../../src/arbitrary/oneof';
+import { anything } from '../../../src/arbitrary/anything';
+import { object, ObjectConstraints } from '../../../src/arbitrary/object';
+import { jsonObject } from '../../../src/arbitrary/jsonObject';
+import { unicodeJsonObject } from '../../../src/arbitrary/unicodeJsonObject';
+import { json } from '../../../src/arbitrary/json';
+import { unicodeJson } from '../../../src/arbitrary/unicodeJson';
+import { boxedArbitraryBuilder } from '../../../src/arbitrary/_internals/builders/BoxedArbitraryBuilder';
 
-import { Random } from '../../../../src/random/generator/Random';
-import { arbitraryFor } from './generic/ArbitraryBuilder';
-import * as stubRng from '../../stubs/generators';
+import { Random } from '../../../src/random/generator/Random';
+import { arbitraryFor } from '../check/arbitrary/generic/ArbitraryBuilder';
+import * as stubRng from '../stubs/generators';
 
 const mrng = () => stubRng.mutable.nocall();
 
@@ -495,7 +492,7 @@ describe('ObjectArbitrary', () => {
     `('Should box any $type', ({ arbitrary }) =>
       fc.assert(
         fc.property(arbitrary, (originalValue) => {
-          const boxedArbitrary = boxArbitrary(arbitraryFor([{ value: originalValue }]));
+          const boxedArbitrary = boxedArbitraryBuilder(arbitraryFor([{ value: originalValue }]));
           const { value } = boxedArbitrary.generate(mrng());
 
           expect(typeof value).toBe('object');
@@ -533,7 +530,7 @@ describe('ObjectArbitrary', () => {
               expect(() => new Ctor(originalValue)).toThrow(); //others like symbol, bigint...
             }
 
-            const boxedArbitrary = boxArbitrary(arbitraryFor([{ value: originalValue }]));
+            const boxedArbitrary = boxedArbitraryBuilder(arbitraryFor([{ value: originalValue }]));
             const { value } = boxedArbitrary.generate(mrng());
             expect(value).toBe(originalValue);
           }