MCPcopy Create free account
hub / github.com/Effect-TS/effect / wrap

Function wrap

packages/effect/src/unstable/rpc/Rpc.ts:1199–1216  ·  view source on GitHub ↗
(options: {
  readonly fork?: boolean | undefined
  readonly uninterruptible?: boolean | undefined
})

Source from the content-addressed store, hash-verified

1197 * @since 4.0.0
1198 */
1199export const wrap = (options: {
1200 readonly fork?: boolean | undefined
1201 readonly uninterruptible?: boolean | undefined
1202}) =>
1203<A extends object>(value: A): Wrapper<A> =>
1204 isWrapper(value) ?
1205 {
1206 [WrapperTypeId]: WrapperTypeId,
1207 value: value.value,
1208 fork: options.fork ?? value.fork,
1209 uninterruptible: options.uninterruptible ?? value.uninterruptible
1210 } :
1211 {
1212 [WrapperTypeId]: WrapperTypeId,
1213 value,
1214 fork: options.fork ?? false,
1215 uninterruptible: options.uninterruptible ?? false
1216 }
1217
1218/**
1219 * Returns the wrapped response value when the input is an RPC `Wrapper`, or the

Callers 2

wrapMapFunction · 0.70
Rpc.tsFile · 0.70

Calls 1

isWrapperFunction · 0.85

Tested by

no test coverage detected