{"version":3,"sources":["../../../src/server/use-cache/clone-cache-entry.ts"],"sourcesContent":["import type { CacheEntry } from '../lib/cache-handlers/types'\n\n/**\n * Tees a cache entry's single-use value stream into two independent entries.\n * The original entry is mutated to hold one branch of the tee, and a clone is\n * returned holding the other, so both can be consumed independently.\n */\nexport function cloneCacheEntry(entry: CacheEntry): [CacheEntry, CacheEntry] {\n  const [streamA, streamB] = entry.value.tee()\n  entry.value = streamA\n  const clonedEntry: CacheEntry = {\n    value: streamB,\n    timestamp: entry.timestamp,\n    revalidate: entry.revalidate,\n    expire: entry.expire,\n    stale: entry.stale,\n    tags: entry.tags,\n  }\n  return [entry, clonedEntry]\n}\n"],"names":["cloneCacheEntry","entry","streamA","streamB","value","tee","clonedEntry","timestamp","revalidate","expire","stale","tags"],"mappings":";;;;+BAOgBA;;;eAAAA;;;AAAT,SAASA,gBAAgBC,KAAiB;IAC/C,MAAM,CAACC,SAASC,QAAQ,GAAGF,MAAMG,KAAK,CAACC,GAAG;IAC1CJ,MAAMG,KAAK,GAAGF;IACd,MAAMI,cAA0B;QAC9BF,OAAOD;QACPI,WAAWN,MAAMM,SAAS;QAC1BC,YAAYP,MAAMO,UAAU;QAC5BC,QAAQR,MAAMQ,MAAM;QACpBC,OAAOT,MAAMS,KAAK;QAClBC,MAAMV,MAAMU,IAAI;IAClB;IACA,OAAO;QAACV;QAAOK;KAAY;AAC7B","ignoreList":[0]}