(value: ValueSchema)
| 339 | |
| 340 | /** Like the default Schema `ReadonlySet` but from Array, with default helpers. */ |
| 341 | export const ReadonlySet = <ValueSchema extends S.Top>(value: ValueSchema) => |
| 342 | pipe( |
| 343 | ReadonlySetFromArray(value), |
| 344 | (s) => |
| 345 | Object.assign(s, { |
| 346 | /** |
| 347 | * Construction-only default `new Set()`. Applied only when the field |
| 348 | * is omitted from `.make(...)` input. NOT applied during decode — |
| 349 | * cannot be used to JIT-migrate database fields. See file-level |
| 350 | * note. |
| 351 | */ |
| 352 | withConstructorDefault: s.pipe( |
| 353 | S.withConstructorDefault(Effect.sync(() => new Set<ValueSchema["Type"]>())) |
| 354 | ), |
| 355 | /** |
| 356 | * Decode-time default `new Set()`. **Discouraged for persisted |
| 357 | * data:** a missing field may be data corruption, not an old-shape |
| 358 | * document; silently substituting an empty set hides the problem. |
| 359 | * Prefer an explicit, preferably versioned migration over a |
| 360 | * decode-time fallback. See file-level note. |
| 361 | */ |
| 362 | withDecodingDefaultType: s.pipe( |
| 363 | S.withDecodingDefaultType(Effect.sync(() => new Set<ValueSchema["Type"]>())) |
| 364 | ) |
| 365 | }) |
| 366 | ) |
| 367 | |
| 368 | /** Like the default Schema `ReadonlyMap` but from Array, with default helpers. */ |
| 369 | export const ReadonlyMap = <KeySchema extends S.Top, ValueSchema extends S.Top>(pair: { |
nothing calls this directly
no test coverage detected
searching dependent graphs…