INNER CODE UNIT · TypeScript

pass

grammyjs/grammY · src/composer.ts:156

function pass<C extends Context>(_ctx: C, next: NextFunction) {
    return next();
}

const leaf: NextFunction = () => Promise.resolve();
/**
 * Runs some given middleware function with a given context object.
 *
 * @param middleware The middleware to run
 * @param ctx The context to use
 */
export async function run<C extends Context>(
    middleware: MiddlewareFn<C>,
    ctx: C,
) {
    await middleware(ctx, leaf);
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…