mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-07 14:38:32 -05:00
feat(cafs): extend cafs with getFilePathByModeInCafs (#5232)
This commit is contained in:
6
.changeset/polite-kings-travel.md
Normal file
6
.changeset/polite-kings-travel.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/cafs": minor
|
||||
"@pnpm/cafs-types": minor
|
||||
---
|
||||
|
||||
Extend cafs with `getFilePathByModeInCafs`.
|
||||
@@ -57,6 +57,7 @@ export interface Cafs {
|
||||
addFilesFromDir: (dir: string, manifest?: DeferredManifestPromise) => Promise<FilesIndex>
|
||||
addFilesFromTarball: (stream: NodeJS.ReadableStream, manifest?: DeferredManifestPromise) => Promise<FilesIndex>
|
||||
getFilePathInCafs: (integrity: string | IntegrityLike, fileType: FileType) => string
|
||||
getFilePathByModeInCafs: (integrity: string | IntegrityLike, mode: number) => string
|
||||
importPackage: ImportPackageFunction
|
||||
tempDir: () => Promise<string>
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ export default function createCafs (cafsDir: string, ignore?: ((filename: string
|
||||
addFilesFromDir: addFilesFromDir.bind(null, { addBuffer, addStream }),
|
||||
addFilesFromTarball: addFilesFromTarball.bind(null, addStream, ignore ?? null),
|
||||
getFilePathInCafs: getFilePathInCafs.bind(null, cafsDir),
|
||||
getFilePathByModeInCafs: getFilePathByModeInCafs.bind(null, cafsDir),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user