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

Function DataFromSelf

packages/effect/src/Schema.ts:8432–8449  ·  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

8430 * @since 3.10.0
8431 */
8432export const DataFromSelf = <
8433 S extends Schema.Any,
8434 A extends Readonly<Record<string, unknown>> | ReadonlyArray<unknown>,
8435 I extends Readonly<Record<string, unknown>> | ReadonlyArray<unknown>
8436>(value: S & Schema<A & Schema.Type<S>, I & Schema.Encoded<S>, Schema.Context<S>>): DataFromSelf<S> => {
8437 return declare(
8438 [value],
8439 {
8440 decode: (item) => dataParse(ParseResult.decodeUnknown(item)),
8441 encode: (item) => dataParse(ParseResult.encodeUnknown(item))
8442 },
8443 {
8444 description: `Data<${format(value)}>`,
8445 pretty: dataPretty,
8446 arbitrary: dataArbitrary
8447 }
8448 )
8449}
8450
8451/**
8452 * @category api interface

Callers 1

DataFunction · 0.70

Calls 3

declareInterface · 0.85
dataParseFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected