MCPcopy Create free account
hub / github.com/anomalyco/opencode / transform

Function transform

packages/core/src/plugin/promise.ts:37–43  ·  view source on GitHub ↗
(domain: {
            transform: (
              callback: (draft: Draft) => Effect.Effect<void> | void,
            ) => Effect.Effect<HostRegistration, never, Scope.Scope>
          })

Source from the content-addressed store, hash-verified

35
36 const transform =
37 <Draft>(domain: {
38 transform: (
39 callback: (draft: Draft) => Effect.Effect<void> | void,
40 ) => Effect.Effect<HostRegistration, never, Scope.Scope>
41 }) =>
42 (callback: (draft: Draft) => Promise<void> | void) =>
43 register(domain.transform((draft) => Effect.promise(() => Promise.resolve(callback(draft)))))
44
45 const context2: PluginContext = {
46 options: host.options,

Callers 5

applyFunction · 0.85
fromPromiseFunction · 0.85
mapProviderOptionsFunction · 0.85
bodyFunction · 0.85
redactBodyFunction · 0.85

Calls 3

registerFunction · 0.70
callbackFunction · 0.50
transformMethod · 0.45

Tested by

no test coverage detected