Files
SnowLuma/.pnpm-store/v11/files/e2/124f8a2d0edec45fafa67aac5f56c5204a9084fedb930838835f0bedfe5cd298da352755ced661e0a0714926875bcac0caf0b802b26479bb6d20e5bfc78423
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

23 lines
957 B
Plaintext

//#region src/adapter/cloudflare-workers/utils.ts
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
const getContentFromKVAsset = async (path, options) => {
let ASSET_MANIFEST;
if (options && options.manifest) {
if (typeof options.manifest === "string") ASSET_MANIFEST = JSON.parse(options.manifest);
else ASSET_MANIFEST = options.manifest;
} else if (typeof __STATIC_CONTENT_MANIFEST === "string") ASSET_MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST);
else ASSET_MANIFEST = __STATIC_CONTENT_MANIFEST;
let ASSET_NAMESPACE;
if (options && options.namespace) ASSET_NAMESPACE = options.namespace;
else ASSET_NAMESPACE = __STATIC_CONTENT;
const key = ASSET_MANIFEST[path];
if (!key) return null;
const content = await ASSET_NAMESPACE.get(key, { type: "stream" });
if (!content) return null;
return content;
};
//#endregion
export { getContentFromKVAsset };