UNPKG

@jahands/dagger-helpers

Version:

dagger.io helpers for my own projects - not meant for public use

27 lines 1.08 kB
import { AsyncLocalStorage } from 'node:async_hooks'; import type { Secret } from '@dagger.io/dagger'; /** * Structure stored in AsyncLocalStorage, containing both the fully merged * environment variables and the set of variables explicitly passed to the * current decorated function call. */ export interface EnvContext { currentParams: Set<string>; mergedEnv: Record<string, Secret | string | undefined>; } /** * Store for environment variables accessible via AsyncLocalStorage */ export declare const envStorage: AsyncLocalStorage<EnvContext>; /** * Helper to extract parameter names from a function's source code. * Note: This approach using Function.toString() can be fragile and might * break with code minification or complex function definitions. */ export declare function extractParamNames(func: Function): string[]; /** * Decorator factory that wraps a method to capture its arguments based on * extracted parameter names and store them in AsyncLocalStorage. */ export declare function ParamsToEnv(): MethodDecorator; //# sourceMappingURL=env.d.ts.map