effect 4.0.0-beta.91 → 4.0.0-beta.92
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/Schema.d.ts.map +1 -1
- package/dist/Schema.js +10 -7
- package/dist/Schema.js.map +1 -1
- package/package.json +1 -1
- package/src/Schema.ts +14 -3
package/package.json
CHANGED
package/src/Schema.ts
CHANGED
|
@@ -122,6 +122,12 @@ export interface MakeOptions {
|
|
|
122
122
|
* Whether to disable validation for the schema.
|
|
123
123
|
*/
|
|
124
124
|
readonly disableChecks?: boolean | undefined
|
|
125
|
+
|
|
126
|
+
/** @internal */
|
|
127
|
+
readonly "~payload"?: {
|
|
128
|
+
readonly token: unknown
|
|
129
|
+
readonly value: unknown
|
|
130
|
+
}
|
|
125
131
|
}
|
|
126
132
|
|
|
127
133
|
/**
|
|
@@ -12467,6 +12473,8 @@ type InheritStaticMembers<C, Static> = C & Pick<Static, Exclude<keyof Static, ke
|
|
|
12467
12473
|
|
|
12468
12474
|
const immerable: unique symbol = globalThis.Symbol.for("immer-draftable") as any
|
|
12469
12475
|
|
|
12476
|
+
const payloadToken = {}
|
|
12477
|
+
|
|
12470
12478
|
function makeClass<
|
|
12471
12479
|
Self,
|
|
12472
12480
|
S extends Struct<Struct.Fields>,
|
|
@@ -12483,9 +12491,12 @@ function makeClass<
|
|
|
12483
12491
|
|
|
12484
12492
|
const out = class extends Inherited {
|
|
12485
12493
|
constructor(...[input, options]: ReadonlyArray<any>) {
|
|
12486
|
-
|
|
12487
|
-
const
|
|
12488
|
-
|
|
12494
|
+
const internalOptions = options as MakeOptions | undefined
|
|
12495
|
+
const payload = internalOptions?.["~payload"]
|
|
12496
|
+
const value = payload?.token === payloadToken
|
|
12497
|
+
? payload.value
|
|
12498
|
+
: struct.make(input ?? {}, options)
|
|
12499
|
+
super(value, { ...options, disableChecks: true, "~payload": { token: payloadToken, value } })
|
|
12489
12500
|
}
|
|
12490
12501
|
|
|
12491
12502
|
static readonly [TypeId] = TypeId
|