UNPKG

@beignet/core

Version:

Core framework primitives for Beignet

16 lines 512 B
/** * Shared utilities for server hooks. */ /** * Extract requestId from context object if it exists. * This helper reduces type casting duplication throughout the codebase. */ export function getRequestIdFromContext(ctx) { if (ctx !== null && ctx !== undefined && typeof ctx === "object") { const ctxRecord = ctx; const requestId = ctxRecord.requestId; return typeof requestId === "string" ? requestId : undefined; } return undefined; } //# sourceMappingURL=utils.js.map