Skip to content

Commit 3c2df27

Browse files
update incorrect function names and comments
1 parent 049d01c commit 3c2df27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/cloudflare/src/api/cloudflare-context.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function getCloudflareContext<
9797
}
9898

9999
if (options.async) {
100-
return getAndSetCloudflareContextInNextDev();
100+
return getAndSetCloudflareContextInNodejs();
101101
}
102102

103103
// the cloudflare context is initialized by the worker and is always present in production/preview
@@ -154,7 +154,7 @@ function shouldContextInitializationRun(): boolean {
154154
}
155155

156156
/**
157-
* Adds the cloudflare context to the global scope in which the Next.js dev node.js process runs in, enabling
157+
* Adds the cloudflare context to the global scope of the current node.js process, enabling
158158
* future calls to `getCloudflareContext` to retrieve and return such context
159159
*
160160
* @param cloudflareContext the cloudflare context to add to the node.sj global scope
@@ -221,13 +221,13 @@ async function getCloudflareContextFromWrangler<
221221
}
222222

223223
/**
224-
* Gets a local proxy version of the cloudflare context (created using `getPlatformProxy`) when
225-
* running in the standard next dev server (via `next dev`), is also sets this value on the
224+
* Gets a local proxy version of the cloudflare context (created using `getPlatformProxy`) when running
225+
* in a Node.js process (so under `next dev` or for ssg under `next build`), is also sets this value on the
226226
* globalThis so that it can be accessed later.
227227
*
228228
* @returns the local proxy version of the cloudflare context
229229
*/
230-
async function getAndSetCloudflareContextInNextDev<
230+
async function getAndSetCloudflareContextInNodejs<
231231
CfProperties extends Record<string, unknown> = IncomingRequestCfProperties,
232232
Context = ExecutionContext,
233233
>(): Promise<CloudflareContext<CfProperties, Context>> {

0 commit comments

Comments
 (0)