MCPcopy Index your code
hub / github.com/Effect-TS/effect / Data

Function Data

packages/effect/src/Schema.ts:8466–8480  ·  view source on GitHub ↗
(value: S & Schema<A & Schema.Type<S>, I & Schema.Encoded<S>, Schema.Context<S>>)

Source from the content-addressed store, hash-verified

8464 * @since 3.10.0
8465 */
8466export const Data = <
8467 S extends Schema.Any,
8468 A extends Readonly<Record<string, unknown>> | ReadonlyArray<unknown>,
8469 I extends Readonly<Record<string, unknown>> | ReadonlyArray<unknown>
8470>(value: S & Schema<A & Schema.Type<S>, I & Schema.Encoded<S>, Schema.Context<S>>): Data<S> => {
8471 return transform(
8472 value,
8473 DataFromSelf(typeSchema(value)),
8474 {
8475 strict: false,
8476 decode: (i) => decodeData(i),
8477 encode: (a) => Array.isArray(a) ? Array.from(a) : Object.assign({}, a)
8478 }
8479 )
8480}
8481
8482type MissingSelfGeneric<Usage extends string, Params extends string = ""> =
8483 `Missing \`Self\` generic - use \`class Self extends ${Usage}<Self>()(${Params}{ ... })\``

Callers

nothing calls this directly

Calls 4

typeSchemaFunction · 0.85
decodeDataFunction · 0.85
transformInterface · 0.70
DataFromSelfFunction · 0.70

Tested by

no test coverage detected