MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / unwrapThunk

Function unwrapThunk

packages/@contentlayer/utils/src/index.ts:94–100  ·  view source on GitHub ↗
(_: T | (() => T))

Source from the content-addressed store, hash-verified

92export type Thunk<T> = () => T
93
94export const unwrapThunk = <T>(_: T | (() => T)): T => {
95 if (typeof _ === 'function') {
96 return (_ as any)()
97 } else {
98 return _
99 }
100}
101
102export class RawError extends Tagged('RawError')<{ readonly error: unknown }> {}
103

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…