Skip to content

Commit 12b30cd

Browse files
committed
fixup! types
1 parent 31d8168 commit 12b30cd

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

packages/cloudflare/src/cli/commands/populate-cache.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
import type { IncrementalCache, TagCache } from "@opennextjs/aws/types/overrides.js";
1313
import { globSync } from "glob";
1414
import { tqdm } from "ts-tqdm";
15-
import { getPlatformProxy, unstable_readConfig } from "wrangler";
15+
import { getPlatformProxy, type GetPlatformProxyOptions, unstable_readConfig } from "wrangler";
1616

1717
import {
1818
BINDING_NAME as KV_CACHE_BINDING_NAME,
@@ -92,14 +92,11 @@ export function getCacheAssets(opts: BuildOptions): CacheAsset[] {
9292
return assets;
9393
}
9494

95-
async function getPlatformProxyEnv(
96-
populateCacheOptions: { target: WranglerTarget; environment?: string },
97-
envName: keyof CloudflareEnv
98-
) {
99-
const proxy = await getPlatformProxy<CloudflareEnv>(populateCacheOptions);
100-
const prefix = proxy.env[envName];
95+
async function getPlatformProxyEnv<T extends keyof CloudflareEnv>(options: GetPlatformProxyOptions, key: T) {
96+
const proxy = await getPlatformProxy<CloudflareEnv>(options);
97+
const prefix = proxy.env[key];
10198
await proxy.dispose();
102-
return prefix as string | undefined;
99+
return prefix;
103100
}
104101

105102
async function populateR2IncrementalCache(

0 commit comments

Comments
 (0)