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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "effect",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.91",
4
+ "version": "4.0.0-beta.92",
5
5
  "license": "MIT",
6
6
  "description": "The missing standard library for TypeScript, for writing production-grade software.",
7
7
  "homepage": "https://effect.website",
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
- input = input ?? {}
12487
- const validated = struct.make(input, options)
12488
- super({ ...input, ...validated }, { ...options, disableChecks: true })
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