@ghostry/fabricator 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Error/index.js +14 -9
- package/dist/esm/Fabricator/Constructor.js +44 -37
- package/dist/esm/Primitive/object/Fabricator.js +45 -43
- package/dist/esm/Primitive/object/Registry.js +41 -84
- package/dist/esm/Primitive/object/Stages.js +73 -0
- package/dist/esm/Primitive/object/compute/Fabricator.js +1 -7
- package/dist/esm/Primitive/object/compute/Registry.js +2 -4
- package/dist/esm/Primitive/recursive/Terminate.js +5 -13
- package/dist/esm/Unique/Capacity.js +2 -8
- package/dist/esm/Utility/ShallowMerge.js +1 -13
- package/dist/types/Adapter/Core.d.ts +2 -2
- package/dist/types/Adapter/Types.d.ts +1 -1
- package/dist/types/Bound.d.ts +1 -1
- package/dist/types/Distribution/index.d.ts +1 -1
- package/dist/types/Enumeration/Enumerate.d.ts +3 -3
- package/dist/types/Enumeration/Plan.d.ts +1 -1
- package/dist/types/Enumeration/Types.d.ts +4 -4
- package/dist/types/Error/index.d.ts +27 -18
- package/dist/types/Fabricator/Constructor.d.ts +4 -4
- package/dist/types/Fabricator/Fabricate.d.ts +5 -5
- package/dist/types/Fabricator/Types.d.ts +6 -6
- package/dist/types/Harnessing/Core.d.ts +3 -3
- package/dist/types/Harnessing/Salt.d.ts +1 -1
- package/dist/types/Harnessing/Types.d.ts +2 -2
- package/dist/types/Instance/Core.d.ts +4 -4
- package/dist/types/Instance/Stack/Async.d.ts +10 -6
- package/dist/types/Instance/Stack/Sync.d.ts +1 -1
- package/dist/types/Instance/Stack/Visible.d.ts +2 -2
- package/dist/types/Instance/Types.d.ts +6 -6
- package/dist/types/Primitive/always/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/always/Registry.d.ts +2 -2
- package/dist/types/Primitive/always/Schema.d.ts +4 -4
- package/dist/types/Primitive/always/Types.d.ts +2 -2
- package/dist/types/Primitive/always/index.d.ts +5 -5
- package/dist/types/Primitive/array/Admits.d.ts +1 -1
- package/dist/types/Primitive/array/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/array/Registry.d.ts +4 -4
- package/dist/types/Primitive/array/Schema.d.ts +5 -5
- package/dist/types/Primitive/array/Types.d.ts +6 -6
- package/dist/types/Primitive/array/index.d.ts +5 -5
- package/dist/types/Primitive/bigint/Admits.d.ts +1 -1
- package/dist/types/Primitive/bigint/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/bigint/Registry.d.ts +4 -4
- package/dist/types/Primitive/bigint/Schema.d.ts +5 -5
- package/dist/types/Primitive/bigint/Types.d.ts +4 -4
- package/dist/types/Primitive/bigint/index.d.ts +5 -5
- package/dist/types/Primitive/boolean/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/boolean/Registry.d.ts +2 -2
- package/dist/types/Primitive/boolean/Schema.d.ts +5 -5
- package/dist/types/Primitive/boolean/Types.d.ts +3 -3
- package/dist/types/Primitive/boolean/index.d.ts +6 -6
- package/dist/types/Primitive/choice/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/choice/Registry.d.ts +2 -2
- package/dist/types/Primitive/choice/Schema.d.ts +5 -5
- package/dist/types/Primitive/choice/Types.d.ts +4 -4
- package/dist/types/Primitive/choice/index.d.ts +5 -5
- package/dist/types/Primitive/date/Admits.d.ts +1 -1
- package/dist/types/Primitive/date/Defaults.d.ts +2 -2
- package/dist/types/Primitive/date/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/date/Registry.d.ts +3 -3
- package/dist/types/Primitive/date/Schema.d.ts +5 -5
- package/dist/types/Primitive/date/Types.d.ts +6 -6
- package/dist/types/Primitive/date/index.d.ts +5 -5
- package/dist/types/Primitive/derive/Fabricator.d.ts +7 -7
- package/dist/types/Primitive/derive/Registry.d.ts +2 -2
- package/dist/types/Primitive/derive/Schema.d.ts +6 -6
- package/dist/types/Primitive/derive/Types.d.ts +6 -6
- package/dist/types/Primitive/derive/index.d.ts +5 -5
- package/dist/types/Primitive/enum/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/enum/Registry.d.ts +2 -2
- package/dist/types/Primitive/enum/Schema.d.ts +5 -5
- package/dist/types/Primitive/enum/Types.d.ts +3 -3
- package/dist/types/Primitive/enum/index.d.ts +5 -5
- package/dist/types/Primitive/index.d.ts +28 -28
- package/dist/types/Primitive/namespace.d.ts +21 -21
- package/dist/types/Primitive/null/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/null/Registry.d.ts +1 -1
- package/dist/types/Primitive/null/Schema.d.ts +4 -4
- package/dist/types/Primitive/null/Types.d.ts +2 -2
- package/dist/types/Primitive/null/index.d.ts +5 -5
- package/dist/types/Primitive/nullable/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/nullable/Registry.d.ts +2 -2
- package/dist/types/Primitive/nullable/Schema.d.ts +6 -6
- package/dist/types/Primitive/nullable/Types.d.ts +5 -5
- package/dist/types/Primitive/nullable/index.d.ts +6 -6
- package/dist/types/Primitive/nullish/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/nullish/Registry.d.ts +2 -2
- package/dist/types/Primitive/nullish/Schema.d.ts +6 -6
- package/dist/types/Primitive/nullish/Types.d.ts +5 -5
- package/dist/types/Primitive/nullish/index.d.ts +6 -6
- package/dist/types/Primitive/number/Admits.d.ts +1 -1
- package/dist/types/Primitive/number/Defaults.d.ts +1 -1
- package/dist/types/Primitive/number/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/number/Registry.d.ts +5 -5
- package/dist/types/Primitive/number/Schema.d.ts +5 -5
- package/dist/types/Primitive/number/Types.d.ts +6 -6
- package/dist/types/Primitive/number/index.d.ts +5 -5
- package/dist/types/Primitive/object/Fabricator.d.ts +20 -24
- package/dist/types/Primitive/object/Registry.d.ts +9 -11
- package/dist/types/Primitive/object/Schema.d.ts +22 -14
- package/dist/types/Primitive/object/Stages.d.ts +68 -0
- package/dist/types/Primitive/object/Types.d.ts +112 -18
- package/dist/types/Primitive/object/compute/Fabricator.d.ts +13 -14
- package/dist/types/Primitive/object/compute/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/compute/Schema.d.ts +7 -7
- package/dist/types/Primitive/object/compute/Types.d.ts +9 -10
- package/dist/types/Primitive/object/compute/index.d.ts +5 -5
- package/dist/types/Primitive/object/index.d.ts +8 -8
- package/dist/types/Primitive/object/omit/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/omit/index.d.ts +2 -2
- package/dist/types/Primitive/object/omittable/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/object/omittable/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/omittable/Schema.d.ts +6 -6
- package/dist/types/Primitive/object/omittable/Types.d.ts +5 -5
- package/dist/types/Primitive/object/omittable/index.d.ts +6 -6
- package/dist/types/Primitive/object/optional/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/object/optional/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/optional/Schema.d.ts +6 -6
- package/dist/types/Primitive/object/optional/Types.d.ts +5 -5
- package/dist/types/Primitive/object/optional/index.d.ts +6 -6
- package/dist/types/Primitive/object/pick/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/pick/index.d.ts +2 -2
- package/dist/types/Primitive/opaque/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/opaque/Registry.d.ts +2 -2
- package/dist/types/Primitive/opaque/Schema.d.ts +4 -4
- package/dist/types/Primitive/opaque/Types.d.ts +3 -3
- package/dist/types/Primitive/opaque/index.d.ts +5 -5
- package/dist/types/Primitive/record/Admits.d.ts +2 -2
- package/dist/types/Primitive/record/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/record/Registry.d.ts +3 -3
- package/dist/types/Primitive/record/Schema.d.ts +5 -5
- package/dist/types/Primitive/record/Types.d.ts +6 -6
- package/dist/types/Primitive/record/index.d.ts +5 -5
- package/dist/types/Primitive/recursive/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/recursive/Registry.d.ts +4 -4
- package/dist/types/Primitive/recursive/Schema.d.ts +4 -4
- package/dist/types/Primitive/recursive/Terminate.d.ts +1 -1
- package/dist/types/Primitive/recursive/Types.d.ts +3 -3
- package/dist/types/Primitive/recursive/index.d.ts +6 -6
- package/dist/types/Primitive/recursive/self/Fabricator.d.ts +5 -5
- package/dist/types/Primitive/recursive/self/Registry.d.ts +1 -1
- package/dist/types/Primitive/recursive/self/Schema.d.ts +4 -4
- package/dist/types/Primitive/recursive/self/Types.d.ts +2 -2
- package/dist/types/Primitive/recursive/self/index.d.ts +5 -5
- package/dist/types/Primitive/string/Admits.d.ts +1 -1
- package/dist/types/Primitive/string/Capacity.d.ts +1 -1
- package/dist/types/Primitive/string/Constants.d.ts +1 -1
- package/dist/types/Primitive/string/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/string/Registry.d.ts +4 -4
- package/dist/types/Primitive/string/Schema.d.ts +5 -5
- package/dist/types/Primitive/string/Sources.d.ts +1 -1
- package/dist/types/Primitive/string/Types.d.ts +6 -6
- package/dist/types/Primitive/string/index.d.ts +6 -6
- package/dist/types/Primitive/symbol/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/symbol/Registry.d.ts +2 -2
- package/dist/types/Primitive/symbol/Schema.d.ts +5 -5
- package/dist/types/Primitive/symbol/Types.d.ts +3 -3
- package/dist/types/Primitive/symbol/index.d.ts +5 -5
- package/dist/types/Primitive/tuple/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/tuple/Registry.d.ts +2 -2
- package/dist/types/Primitive/tuple/Schema.d.ts +5 -5
- package/dist/types/Primitive/tuple/Types.d.ts +4 -4
- package/dist/types/Primitive/tuple/index.d.ts +5 -5
- package/dist/types/Primitive/undefinable/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/undefinable/Registry.d.ts +2 -2
- package/dist/types/Primitive/undefinable/Schema.d.ts +6 -6
- package/dist/types/Primitive/undefinable/Types.d.ts +5 -5
- package/dist/types/Primitive/undefinable/index.d.ts +6 -6
- package/dist/types/Primitive/undefined/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/undefined/Registry.d.ts +1 -1
- package/dist/types/Primitive/undefined/Schema.d.ts +4 -4
- package/dist/types/Primitive/undefined/Types.d.ts +2 -2
- package/dist/types/Primitive/undefined/index.d.ts +5 -5
- package/dist/types/Primitive/unique/Registry.d.ts +7 -7
- package/dist/types/Primitive/unique/index.d.ts +2 -2
- package/dist/types/Random/Generator/sfc32.d.ts +1 -1
- package/dist/types/Random/Types.d.ts +1 -1
- package/dist/types/Random/index.d.ts +1 -1
- package/dist/types/Schema/Core.d.ts +5 -5
- package/dist/types/Schema/Registry.d.ts +3 -3
- package/dist/types/Schema/Satisfies.d.ts +3 -3
- package/dist/types/Schema/Types.d.ts +5 -5
- package/dist/types/Types.d.ts +2 -2
- package/dist/types/Unique/Capacity.d.ts +1 -1
- package/dist/types/Unique/Distinct.d.ts +6 -6
- package/dist/types/Unique/Strategy.d.ts +5 -5
- package/dist/types/Utility/Core.d.ts +2 -2
- package/dist/types/Utility/DeepMerge.d.ts +2 -2
- package/dist/types/Utility/ShallowMerge.d.ts +7 -3
- package/dist/types/adapting.d.ts +3 -3
- package/dist/types/harnessing.d.ts +2 -2
- package/dist/types/index.d.ts +30 -30
- package/dist/types/internal.d.ts +16 -16
- package/package.json +2 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Ancestry, Stack } from "../Instance/Types";
|
|
2
|
-
import type { RandomSource } from "../Random/Types";
|
|
3
|
-
import type { Enumerable, Limits } from "./Types";
|
|
1
|
+
import type { Ancestry, Stack } from "../Instance/Types.ts";
|
|
2
|
+
import type { RandomSource } from "../Random/Types.ts";
|
|
3
|
+
import type { Enumerable, Limits } from "./Types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Typed `combinatorial`/`coverage` boundary, closing over one instance's
|
|
6
6
|
* `source` and its already-validated `limits` — same shape as
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Kind as SchemaKind } from "../Primitive";
|
|
2
|
-
import type { AnySchema, Fabricated } from "../Schema/Types";
|
|
3
|
-
import type { Children, Kind, Meta } from "../Types";
|
|
4
|
-
import type { PlainObject } from "../Utility/Types";
|
|
1
|
+
import type { Kind as SchemaKind } from "../Primitive/index.ts";
|
|
2
|
+
import type { AnySchema, Fabricated } from "../Schema/Types.ts";
|
|
3
|
+
import type { Children, Kind, Meta } from "../Types.ts";
|
|
4
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* How a composite with more than one child combines their widths. `"product"`
|
|
7
7
|
* is the cartesian product — width is the product of every child's width;
|
|
@@ -224,9 +224,11 @@ export declare namespace FabricatorError {
|
|
|
224
224
|
key: string);
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
|
-
* A `.refine()`-computed field
|
|
228
|
-
*
|
|
229
|
-
*
|
|
227
|
+
* A `.refine()`-computed field built or fabricated outside the object that
|
|
228
|
+
* owns it: placed in an array, tuple, or any other position, or a built
|
|
229
|
+
* field's `.fabricate()` called on its own. A computed field's value is
|
|
230
|
+
* derived from its sibling fields, so there is nothing to resolve against
|
|
231
|
+
* anywhere else.
|
|
230
232
|
*/
|
|
231
233
|
class DetachedComputeError extends FabricatorError {
|
|
232
234
|
constructor();
|
|
@@ -279,9 +281,9 @@ export declare namespace FabricatorError {
|
|
|
279
281
|
}
|
|
280
282
|
/**
|
|
281
283
|
* A key names a field the object schema does not define — most often a typo,
|
|
282
|
-
* which is why the known fields are listed. One failure reached from
|
|
283
|
-
* places: `.override()`, `T.pick`, `T.omit`, and a compute
|
|
284
|
-
* `.from([...])`, told apart by `operation`.
|
|
284
|
+
* which is why the known fields are listed. One failure reached from five
|
|
285
|
+
* places: `.override()`, `.rebase()`, `T.pick`, `T.omit`, and a compute
|
|
286
|
+
* field's `.from([...])`, told apart by `operation`.
|
|
285
287
|
*/
|
|
286
288
|
class UnknownFieldError extends FabricatorError {
|
|
287
289
|
/**
|
|
@@ -296,7 +298,7 @@ export declare namespace FabricatorError {
|
|
|
296
298
|
/**
|
|
297
299
|
* What named the unknown field, worded to read as the message's verb.
|
|
298
300
|
*/
|
|
299
|
-
readonly operation: "override" | "pick" | "omit" | "compute from";
|
|
301
|
+
readonly operation: "override" | "pick" | "omit" | "compute from" | "rebase";
|
|
300
302
|
constructor(
|
|
301
303
|
/**
|
|
302
304
|
* The name that was not found.
|
|
@@ -310,25 +312,32 @@ export declare namespace FabricatorError {
|
|
|
310
312
|
/**
|
|
311
313
|
* What named the unknown field, worded to read as the message's verb.
|
|
312
314
|
*/
|
|
313
|
-
operation: "override" | "pick" | "omit" | "compute from");
|
|
315
|
+
operation: "override" | "pick" | "omit" | "compute from" | "rebase");
|
|
314
316
|
}
|
|
315
317
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* never at fabrication.
|
|
318
|
+
* A `.refine()`-computed field placed in an object some other way: in
|
|
319
|
+
* `T.object(...)`, or passed to `.extend(...)` or `.rebase(...)`. A computed
|
|
320
|
+
* field reads the object as of the `.refine()` stage that created it, so it
|
|
321
|
+
* only exists inside that stage.
|
|
321
322
|
*/
|
|
322
|
-
class
|
|
323
|
+
class ComputeOutsideRefineError extends FabricatorError {
|
|
323
324
|
/**
|
|
324
|
-
* The
|
|
325
|
+
* The field the computed field was placed under.
|
|
325
326
|
*/
|
|
326
|
-
readonly
|
|
327
|
+
readonly field: string;
|
|
328
|
+
/**
|
|
329
|
+
* Where it was placed.
|
|
330
|
+
*/
|
|
331
|
+
readonly operation: "object" | "extend" | "rebase";
|
|
327
332
|
constructor(
|
|
328
333
|
/**
|
|
329
|
-
* The
|
|
334
|
+
* The field the computed field was placed under.
|
|
335
|
+
*/
|
|
336
|
+
field: string,
|
|
337
|
+
/**
|
|
338
|
+
* Where it was placed.
|
|
330
339
|
*/
|
|
331
|
-
|
|
340
|
+
operation: "object" | "extend" | "rebase");
|
|
332
341
|
}
|
|
333
342
|
/**
|
|
334
343
|
* An override value does not fit the field it is meant to replace. Raised for
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Ancestry, Stack } from "../Instance/Types";
|
|
2
|
-
import type { ConstructorOptions, RandomSource } from "../Random/Types";
|
|
3
|
-
import { type Buildable } from "../Types";
|
|
4
|
-
import { type AsFabricator, type Exhaustion } from "./Types";
|
|
1
|
+
import type { Ancestry, Stack } from "../Instance/Types.ts";
|
|
2
|
+
import type { ConstructorOptions, RandomSource } from "../Random/Types.ts";
|
|
3
|
+
import { type Buildable } from "../Types.ts";
|
|
4
|
+
import { type AsFabricator, type Exhaustion } from "./Types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* The type of `construct()` itself, as handed back by `Constructor` — kept
|
|
7
7
|
* separate so `initialize`'s return type (`src/index.ts`) can name it without
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Ancestry, Stack } from "../Instance/Types";
|
|
2
|
-
import type { RandomSource } from "../Random/Types";
|
|
3
|
-
import type { AnySchema, Fabricated } from "../Schema/Types";
|
|
4
|
-
import type { Constructor } from "./Constructor";
|
|
5
|
-
import type { NaiveFabricator } from "./Types";
|
|
1
|
+
import type { Ancestry, Stack } from "../Instance/Types.ts";
|
|
2
|
+
import type { RandomSource } from "../Random/Types.ts";
|
|
3
|
+
import type { AnySchema, Fabricated } from "../Schema/Types.ts";
|
|
4
|
+
import type { Constructor } from "./Constructor.ts";
|
|
5
|
+
import type { NaiveFabricator } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* `new Fabricator(schema).fabricate()` in one call, without a build per call:
|
|
8
8
|
* the first call with a given schema in a given scope builds, and every later
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Adaptations, AdaptationsOf } from "../Adapter/Types";
|
|
2
|
-
import type { Primitive, Kind as SchemaKind } from "../Primitive";
|
|
3
|
-
import type { Algorithm, RandomSource, Salt, Trace } from "../Random/Types";
|
|
4
|
-
import type { Fabricated } from "../Schema/Types";
|
|
5
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../Types";
|
|
6
|
-
import type { PlainObject } from "../Utility/Types";
|
|
1
|
+
import type { Adaptations, AdaptationsOf } from "../Adapter/Types.ts";
|
|
2
|
+
import type { Primitive, Kind as SchemaKind } from "../Primitive/index.ts";
|
|
3
|
+
import type { Algorithm, RandomSource, Salt, Trace } from "../Random/Types.ts";
|
|
4
|
+
import type { Fabricated } from "../Schema/Types.ts";
|
|
5
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../Types.ts";
|
|
6
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
7
7
|
/**
|
|
8
8
|
* Threaded through `Constructor.ts`'s `make` for every dispatch of one `new
|
|
9
9
|
* Fabricator(...)` construction — every branch forwards it (extending `path`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Instance } from "../Instance/Types";
|
|
2
|
-
import type { PlainObject } from "../Utility/Types";
|
|
3
|
-
import type { FabricatorTestContext, Integration } from "./Types";
|
|
1
|
+
import type { Instance } from "../Instance/Types.ts";
|
|
2
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
3
|
+
import type { FabricatorTestContext, Integration } from "./Types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Decorate an existing `Instance` as a `@ghostry/harness` integration. The
|
|
6
6
|
* whole of it is `context.scope().wrap({ salt: layer(saltFor(identity)) })` —
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Instance } from "../Instance/Types";
|
|
2
|
-
import type { PlainObject } from "../Utility/Types";
|
|
1
|
+
import type { Instance } from "../Instance/Types.ts";
|
|
2
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* What identifies one registered test or suite — the material a salt is derived
|
|
5
5
|
* from. Named to match how this codebase already talks about the concept:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type FabricatorCache } from "../Fabricator/Fabricate";
|
|
2
|
-
import type { RandomSource } from "../Random/Types";
|
|
3
|
-
import type { PlainObject } from "../Utility/Types";
|
|
4
|
-
import type { Ancestry, Config, Instance, Overlay, Stack } from "./Types";
|
|
1
|
+
import { type FabricatorCache } from "../Fabricator/Fabricate.ts";
|
|
2
|
+
import type { RandomSource } from "../Random/Types.ts";
|
|
3
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
4
|
+
import type { Ancestry, Config, Instance, Overlay, Stack } from "./Types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* `combinatorial`'s default limit — `2**10`, so it admits ten independent
|
|
7
7
|
* binary axes before requiring the caller to raise it explicitly. Each
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import type { Stack } from "../Types";
|
|
1
|
+
import type { Stack } from "../Types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* The asynchronous carrier, and the **only** module in this package importing
|
|
4
|
-
* anything from `node:`. Nothing imports it directly: `
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* anything from `node:`. Nothing imports it directly: `src/index.ts` imports
|
|
5
|
+
* `#stack`, whose `node`/`bun` conditions (`package.json`) resolve here while
|
|
6
|
+
* `default` resolves to `./Sync.ts`. That is what keeps the package importable
|
|
7
|
+
* on a runtime with no `node:async_hooks` while every runtime that has one gets
|
|
8
|
+
* async-safe `wrap` with nothing to configure. Deno reaches this file both ways
|
|
9
|
+
* it can install the package: from npm through the `node` condition (built
|
|
10
|
+
* output, under `dist/`), and from JSR through `jsr.json`'s import map, which
|
|
11
|
+
* resolves `#stack` here when the package is published. A `deno` condition in
|
|
12
|
+
* `package.json` would serve both, but npm ships no `src/`.
|
|
9
13
|
*
|
|
10
14
|
* The store holds the whole open chain, not one `Frame`: `run` _replaces_ the
|
|
11
15
|
* store for the duration of `block`, so `enter` rebuilds the chain with the new
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RandomSource } from "../../Random/Types";
|
|
2
|
-
import type { Ancestry, Frame, Stack } from "../Types";
|
|
1
|
+
import type { RandomSource } from "../../Random/Types.ts";
|
|
2
|
+
import type { Ancestry, Frame, Stack } from "../Types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* The frames in `frames` that `ancestry` may resolve against, outermost first —
|
|
5
5
|
* the single definition of {@link Stack.visible}'s rule, which both carriers
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Capacity } from "../Unique/Capacity";
|
|
2
|
-
import type { Enumerable, Limits } from "../Enumeration/Types";
|
|
3
|
-
import type { Constructor } from "../Fabricator/Constructor";
|
|
4
|
-
import type { Fabricate } from "../Fabricator/Fabricate";
|
|
5
|
-
import type { Algorithm, Layered, RandomSource, Salt } from "../Random/Types";
|
|
6
|
-
import type { PlainObject } from "../Utility/Types";
|
|
1
|
+
import type { Capacity } from "../Unique/Capacity.ts";
|
|
2
|
+
import type { Enumerable, Limits } from "../Enumeration/Types.ts";
|
|
3
|
+
import type { Constructor } from "../Fabricator/Constructor.ts";
|
|
4
|
+
import type { Fabricate } from "../Fabricator/Fabricate.ts";
|
|
5
|
+
import type { Algorithm, Layered, RandomSource, Salt } from "../Random/Types.ts";
|
|
6
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
7
7
|
/**
|
|
8
8
|
* A fully resolved instance configuration — every field present, nothing left
|
|
9
9
|
* to default. `Overlay` is what `fork` accepts; `overlay()`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Meta as ThisMeta, Value } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Meta as ThisMeta, Value } from "./Types.ts";
|
|
7
7
|
export type Fabrication<$Fabricator extends Fabricator> = $Fabricator extends Fabricator<infer $Schema> ? Fabricated<$Schema[typeof Meta]["value"]> : never;
|
|
8
8
|
export type Fabricator<$Schema extends {
|
|
9
9
|
[Meta]: ThisMeta;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Schema } from "./Schema";
|
|
2
|
-
import type { Value } from "./Types";
|
|
1
|
+
import { Schema } from "./Schema.ts";
|
|
2
|
+
import type { Value } from "./Types.ts";
|
|
3
3
|
export default function <const $Value extends Value>(value: $Value): Schema<$Value>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
4
|
-
import type { Core, Fabricated, Value } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
4
|
+
import type { Core, Fabricated, Value } from "./Types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* A fixed value, so unlike every other kind there is no `.as()` — nothing left
|
|
7
7
|
* to override about producing it. `adapt` still applies: what a value _means_
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Any value at all. Deliberately unconstrained: fabricating a fixed value needs
|
|
5
5
|
* nothing of it. A `string | number | boolean` cap would be TypeBox's
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Types";
|
|
2
|
-
export * from "./Schema";
|
|
3
|
-
export * from "./Fabricator";
|
|
4
|
-
export * from "./Registry";
|
|
5
|
-
export { default } from "./Registry";
|
|
1
|
+
export * from "./Types.ts";
|
|
2
|
+
export * from "./Schema.ts";
|
|
3
|
+
export * from "./Fabricator.ts";
|
|
4
|
+
export * from "./Registry.ts";
|
|
5
|
+
export { default } from "./Registry.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Admits, InputAdmits, Meta } from "./Types";
|
|
1
|
+
import type { Admits, InputAdmits, Meta } from "./Types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Resolve `.admits(...)` against what is admitted already: `meta.admits`, or by
|
|
4
4
|
* default the drawn `length` — what an adapter states without one. Under
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { Fabricator as BaseFabricator, FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Children, Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Definition, Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Fabricator as BaseFabricator, FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Children, Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Definition, Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<$Fabricator extends Fabricator> = $Fabricator extends Fabricator<infer $Schema extends {
|
|
8
8
|
[Meta]: ThisMeta;
|
|
9
9
|
}> ? Fabricated<$Schema[typeof Meta]["definition"]> : never;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Produce } from "../../Random/Types";
|
|
2
|
-
import type { Fabricated as FabricatedBy } from "../../Schema/Types";
|
|
3
|
-
import { Schema } from "./Schema";
|
|
4
|
-
import type { Definition, Fabricated, InputUniqueWhereby, InputWhereby } from "./Types";
|
|
1
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
2
|
+
import type { Fabricated as FabricatedBy } from "../../Schema/Types.ts";
|
|
3
|
+
import { Schema } from "./Schema.ts";
|
|
4
|
+
import type { Definition, Fabricated, InputUniqueWhereby, InputWhereby } from "./Types.ts";
|
|
5
5
|
type ThisRegistry<$Definition extends Definition> = {
|
|
6
6
|
/**
|
|
7
7
|
* An array of `definition`, repeated `length` times. `length` is a bare `N`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { Core, Definition, Fabricated, InputAdmits } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { Core, Definition, Fabricated, InputAdmits } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* The buildable recipe for an `array`: a single element Schema, repeated
|
|
8
8
|
* `whereby.length` times.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { AdmittedEnds, InputAdmittedEnds, InputLength, Length } from "../../Bound";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import type { AnySchema, Fabricated as FabricatedBy } from "../../Schema/Types";
|
|
5
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
6
|
-
import type { Redraws } from "../../Unique/Strategy";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { AdmittedEnds, InputAdmittedEnds, InputLength, Length } from "../../Bound.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import type { AnySchema, Fabricated as FabricatedBy } from "../../Schema/Types.ts";
|
|
5
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
6
|
+
import type { Redraws } from "../../Unique/Strategy.ts";
|
|
7
7
|
export type Definition = AnySchema;
|
|
8
8
|
export type Fabricated<$Definition extends Definition, $Bindings extends unknown[] = []> = Array<FabricatedBy<$Definition, $Bindings>>;
|
|
9
9
|
export type InputWhereby = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Types";
|
|
2
|
-
export * from "./Schema";
|
|
3
|
-
export * from "./Fabricator";
|
|
4
|
-
export * from "./Registry";
|
|
5
|
-
export { default } from "./Registry";
|
|
1
|
+
export * from "./Types.ts";
|
|
2
|
+
export * from "./Schema.ts";
|
|
3
|
+
export * from "./Fabricator.ts";
|
|
4
|
+
export * from "./Registry.ts";
|
|
5
|
+
export { default } from "./Registry.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Admits, InputAdmits, Meta } from "./Types";
|
|
1
|
+
import type { Admits, InputAdmits, Meta } from "./Types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Resolve `.admits(...)` against what is admitted already: `meta.admits`, or by
|
|
4
4
|
* default the drawn range — what an adapter states without one. Under
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Claim, Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Claim, Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<_ extends Fabricator> = Fabricated;
|
|
8
8
|
export type Fabricator<$Schema extends {
|
|
9
9
|
[Meta]: ThisMeta;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Produce } from "../../Random/Types";
|
|
2
|
-
import { Kind } from "../../Types";
|
|
3
|
-
import { Schema } from "./Schema";
|
|
4
|
-
import type { Fabricated, InputWhereby, Whereby } from "./Types";
|
|
1
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
2
|
+
import { Kind } from "../../Types.ts";
|
|
3
|
+
import { Schema } from "./Schema.ts";
|
|
4
|
+
import type { Fabricated, InputWhereby, Whereby } from "./Types.ts";
|
|
5
5
|
declare const _default: {
|
|
6
6
|
/**
|
|
7
7
|
* The builder carries the primitive's `[Kind]` so it can be named directly as
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { Admits, Core, Fabricated, InputAdmits, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { Admits, Core, Fabricated, InputAdmits, Meta as ThisMeta } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Buildable `bigint` recipe: a range (`whereby` — required, like `string`; no
|
|
8
8
|
* natural bound to fuzz to), or opaque production via `as`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { AdmittedEnds, Bound, InputAdmittedEnds, InputBound } from "../../Bound";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { AdmittedEnds, Bound, InputAdmittedEnds, InputBound } from "../../Bound.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Call-site `{ min?, max }`. Either end may be a `number` that is a safe
|
|
7
7
|
* integer (`Bound.ts`'s `toBigintBound`), stored as a `bigint`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Types";
|
|
2
|
-
export * from "./Schema";
|
|
3
|
-
export * from "./Fabricator";
|
|
4
|
-
export * from "./Registry";
|
|
5
|
-
export { default } from "./Registry";
|
|
1
|
+
export * from "./Types.ts";
|
|
2
|
+
export * from "./Schema.ts";
|
|
3
|
+
export * from "./Fabricator.ts";
|
|
4
|
+
export * from "./Registry.ts";
|
|
5
|
+
export { default } from "./Registry.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<_ extends Fabricator> = Fabricated;
|
|
8
8
|
export type Fabricator<$Schema extends {
|
|
9
9
|
[Meta]: ThisMeta;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import { Schema } from "./Schema";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import { Schema } from "./Schema.ts";
|
|
3
3
|
/**
|
|
4
4
|
* A function, not the Schema itself: `Schema/Registry.ts` installs it as the
|
|
5
5
|
* `T.boolean` getter, so every read is a distinct Schema — see AGENTS.md's
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { Core, Fabricated, Meta as ThisMeta, Weights } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { Core, Fabricated, Meta as ThisMeta, Weights } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Buildable `boolean` recipe: an even coin flip, a weighted one (`weights`), or
|
|
8
8
|
* opaque production via `as`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { Produce } from "../../Random/Types";
|
|
3
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
3
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
4
4
|
export type Fabricated = boolean;
|
|
5
5
|
export type Weights = {
|
|
6
6
|
true: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./Fabricator";
|
|
2
|
-
export * from "./Outcomes";
|
|
3
|
-
export * from "./Registry";
|
|
4
|
-
export { default } from "./Registry";
|
|
5
|
-
export * from "./Schema";
|
|
6
|
-
export * from "./Types";
|
|
1
|
+
export * from "./Fabricator.ts";
|
|
2
|
+
export * from "./Outcomes.ts";
|
|
3
|
+
export * from "./Registry.ts";
|
|
4
|
+
export { default } from "./Registry.ts";
|
|
5
|
+
export * from "./Schema.ts";
|
|
6
|
+
export * from "./Types.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Children, Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Items, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Children, Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Items, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<$Fabricator extends Fabricator> = $Fabricator extends Fabricator<infer $Schema extends {
|
|
8
8
|
[Meta]: ThisMeta;
|
|
9
9
|
}> ? Fabricated<$Schema[typeof Meta]["items"]> : never;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Schema } from "./Schema";
|
|
2
|
-
import type { Item, Items } from "./Types";
|
|
1
|
+
import { Schema } from "./Schema.ts";
|
|
2
|
+
import type { Item, Items } from "./Types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Tuple-preserving: a mapped type over `$Items` keeps its exact length and
|
|
5
5
|
* per-position option types (`{ [K in keyof $Items]: ... }` walks a tuple
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { Core, Fabricated, Items } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { Core, Fabricated, Items } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Buildable `choice` recipe: a weighted set of option Schemas, one of which is
|
|
8
8
|
* drawn (and only then dispatched into a value) each fabrication. No bare form
|