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

Function script

packages/effect/src/unstable/persistence/Redis.ts:179–193  ·  view source on GitHub ↗
(
  f: (...params: Params) => ReadonlyArray<unknown>,
  options: {
    readonly lua: string
    readonly numberOfKeys: number | ((...params: Params) => number)
  }
)

Source from the content-addressed store, hash-verified

177 * @since 4.0.0
178 */
179export const script = <Params extends ReadonlyArray<any>>(
180 f: (...params: Params) => ReadonlyArray<unknown>,
181 options: {
182 readonly lua: string
183 readonly numberOfKeys: number | ((...params: Params) => number)
184 }
185): Script<{
186 params: Params
187 result: void
188}> =>
189 Object.setPrototypeOf({
190 ...options,
191 params: f,
192 numberOfKeys: typeof options.numberOfKeys === "number" ? constant(options.numberOfKeys) : options.numberOfKeys
193 }, ScriptProto)

Callers

nothing calls this directly

Calls 1

constantFunction · 0.90

Tested by

no test coverage detected