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

Function apply

packages/sql/sqlite-node/test/PersistedQueue.test.ts:43–54  ·  view source on GitHub ↗
(target, thisArg, args)

Source from the content-addressed store, hash-verified

41 let slowNextRefresh = false
42 const delayedSql: SqlClient.SqlClient = new Proxy(sql, {
43 apply(target, thisArg, args) {
44 const statement = Reflect.apply(target, thisArg, args)
45 if (
46 slowNextRefresh &&
47 Array.isArray(args[0]) &&
48 args[0].some((part: string) => part.includes("SET acquired_at ="))
49 ) {
50 slowNextRefresh = false
51 return Effect.tap(statement, () => Effect.sleep("8 seconds"))
52 }
53 return statement
54 },
55 get(target, prop, receiver) {
56 return prop === "withoutTransforms" ? () => delayedSql : Reflect.get(target, prop, receiver)
57 }

Callers

nothing calls this directly

Calls 3

someMethod · 0.80
sleepMethod · 0.65
applyMethod · 0.45

Tested by

no test coverage detected