Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
17
Frontend-Learner/node_modules/nitropack/dist/runtime/internal/context.mjs
generated
vendored
Normal file
17
Frontend-Learner/node_modules/nitropack/dist/runtime/internal/context.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { createError } from "h3";
|
||||
import { getContext } from "unctx";
|
||||
export const nitroAsyncContext = getContext("nitro-app", {
|
||||
asyncContext: import.meta._asyncContext,
|
||||
AsyncLocalStorage: import.meta._asyncContext ? AsyncLocalStorage : void 0
|
||||
});
|
||||
export function useEvent() {
|
||||
try {
|
||||
return nitroAsyncContext.use().event;
|
||||
} catch {
|
||||
const hint = import.meta._asyncContext ? "Note: This is an experimental feature and might be broken on non-Node.js environments." : "Enable the experimental flag using `experimental.asyncContext: true`.";
|
||||
throw createError({
|
||||
message: `Nitro request context is not available. ${hint}`
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue