@@ -201,7 +201,7 @@ export async function cleanDlxCache(
201201
202202 for ( const entry of entries ) {
203203 const entryPath = path . join ( cacheDir , entry )
204- const metaPath = getMetadataPath ( entryPath )
204+ const metaPath = getBinaryCacheMetadataPath ( entryPath )
205205
206206 try {
207207 // eslint-disable-next-line no-await-in-loop
@@ -287,11 +287,11 @@ export async function dlxBinary(
287287 if (
288288 ! force &&
289289 fs . existsSync ( cacheEntryDir ) &&
290- ( await isCacheValid ( cacheEntryDir , cacheTtl ) )
290+ ( await isBinaryCacheValid ( cacheEntryDir , cacheTtl ) )
291291 ) {
292292 // Binary is cached and valid, read the integrity from metadata.
293293 try {
294- const metaPath = getMetadataPath ( cacheEntryDir )
294+ const metaPath = getBinaryCacheMetadataPath ( cacheEntryDir )
295295 const metadata = await readJson ( metaPath , { throws : false } )
296296 if (
297297 metadata &&
@@ -350,7 +350,7 @@ export async function dlxBinary(
350350
351351 // Get file size for metadata.
352352 const stats = await fs . promises . stat ( binaryPath )
353- await writeMetadata (
353+ await writeBinaryCacheMetadata (
354354 cacheEntryDir ,
355355 cacheKey ,
356356 url ,
@@ -431,7 +431,7 @@ export async function downloadBinary(
431431 if (
432432 ! force &&
433433 fs . existsSync ( cacheEntryDir ) &&
434- ( await isCacheValid ( cacheEntryDir , cacheTtl ) )
434+ ( await isBinaryCacheValid ( cacheEntryDir , cacheTtl ) )
435435 ) {
436436 // Binary is cached and valid.
437437 downloaded = false
@@ -470,7 +470,7 @@ export async function downloadBinary(
470470
471471 // Get file size for metadata.
472472 const stats = await fs . promises . stat ( binaryPath )
473- await writeMetadata (
473+ await writeBinaryCacheMetadata (
474474 cacheEntryDir ,
475475 cacheKey ,
476476 url ,
@@ -622,20 +622,20 @@ export function getDlxCachePath(): string {
622622/**
623623 * Get metadata file path for a cached binary.
624624 */
625- export function getMetadataPath ( cacheEntryPath : string ) : string {
625+ export function getBinaryCacheMetadataPath ( cacheEntryPath : string ) : string {
626626 return getPath ( ) . join ( cacheEntryPath , '.dlx-metadata.json' )
627627}
628628
629629/**
630630 * Check if a cached binary is still valid.
631631 */
632- export async function isCacheValid (
632+ export async function isBinaryCacheValid (
633633 cacheEntryPath : string ,
634634 cacheTtl : number ,
635635) : Promise < boolean > {
636636 const fs = getFs ( )
637637 try {
638- const metaPath = getMetadataPath ( cacheEntryPath )
638+ const metaPath = getBinaryCacheMetadataPath ( cacheEntryPath )
639639 if ( ! fs . existsSync ( metaPath ) ) {
640640 return false
641641 }
@@ -693,7 +693,7 @@ export async function listDlxCache(): Promise<
693693 continue
694694 }
695695
696- const metaPath = getMetadataPath ( entryPath )
696+ const metaPath = getBinaryCacheMetadataPath ( entryPath )
697697 // eslint-disable-next-line no-await-in-loop
698698 const metadata = await readJson ( metaPath , { throws : false } )
699699 if (
@@ -741,14 +741,14 @@ export async function listDlxCache(): Promise<
741741 * Uses unified schema shared with C++ decompressor and CLI dlxBinary.
742742 * Schema documentation: See DlxMetadata interface in this file (exported).
743743 */
744- export async function writeMetadata (
744+ export async function writeBinaryCacheMetadata (
745745 cacheEntryPath : string ,
746746 cacheKey : string ,
747747 url : string ,
748748 integrity : string ,
749749 size : number ,
750750) : Promise < void > {
751- const metaPath = getMetadataPath ( cacheEntryPath )
751+ const metaPath = getBinaryCacheMetadataPath ( cacheEntryPath )
752752 const metadata : DlxMetadata = {
753753 version : '1.0.0' ,
754754 cache_key : cacheKey ,
0 commit comments