(
manifest: WebAssetManifest,
options: WebAssetOptions = {},
)
| 140 | } |
| 141 | |
| 142 | export function getWebAssetCacheRoot( |
| 143 | manifest: WebAssetManifest, |
| 144 | options: WebAssetOptions = {}, |
| 145 | ): string { |
| 146 | const version = sanitizeSegment(options.version ?? KIMI_BUILD_INFO.version ?? 'dev'); |
| 147 | const manifestHash = sha256(JSON.stringify(manifest)); |
| 148 | return join( |
| 149 | getNativeCacheBase({ |
| 150 | cacheBase: options.cacheBase, |
| 151 | env: options.env, |
| 152 | platform: options.platform, |
| 153 | homeDir: options.homeDir, |
| 154 | }), |
| 155 | 'web', |
| 156 | version, |
| 157 | sanitizeSegment(manifest.target), |
| 158 | manifestHash, |
| 159 | manifest.root, |
| 160 | ); |
| 161 | } |
| 162 | |
| 163 | export function getNativeWebAssetsDir(options: WebAssetOptions = {}): string | null { |
| 164 | const source = options.source ?? getSeaAssetSource(); |
no test coverage detected