import { getPrefix } from "./getPrefix" export function generateCacheKey( key: string | string[], options?: { includeGitHashInKey?: boolean } ): string { const includeGitHashInKey = options?.includeGitHashInKey ?? true const keyArray = (Array.isArray(key) ? key : [key]).filter(Boolean) if (keyArray.length === 0) { throw new Error("No keys provided") } const prefix = getPrefix({ includeGitHashInKey, includeBranchPrefix: true, }) const keyTokens = [prefix, keyArray.join("_")].filter(Boolean).join(":") return keyTokens }