Skip to content
This repository was archived by the owner on Jan 2, 2022. It is now read-only.

Commit 6695550

Browse files
committed
fix: fix options parameter for cache functions
Signed-off-by: Jonah Snider <[email protected]>
1 parent f54d11b commit 6695550

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {join as joinPaths} from 'path';
22

33
interface NetlifyUtils {
44
cache: {
5-
restore(path: string, options: {digest: string[]}): Promise<any>;
6-
save(path: string, options: {digest: string[]}): Promise<any>;
5+
restore(path: string, options?: Partial<{move: boolean}>): Promise<any>;
6+
save(path: string, options?: Partial<{digests: string[]; move: boolean; ttl: number}>): Promise<any>;
77
};
88
}
99

@@ -39,9 +39,9 @@ function generateAbsolutePaths(
3939
const buildDirPathFromProject = options.inputs.build_dir_path ?? '.';
4040

4141
/** The absolute path to the build folder for Next.js. */
42-
const absoluteBuildDirPath = joinPaths(options.netlifyConfig.build.base, buildDirPathFromProject, buildDirName, 'cache');
43-
/** The absolute path to the build manifest Next.js uses. */
44-
// I don't actually know if this build manifest has any relation to the cache folder
42+
const absoluteBuildDirPath = joinPaths(options.netlifyConfig.build.base, buildDirPathFromProject, buildDirName, 'cache');
43+
/** The absolute path to the build manifest Next.js uses. */
44+
// I don't actually know if this build manifest has any relation to the cache folder
4545
const manifestPath = joinPaths(absoluteBuildDirPath, '..', 'build-manifest.json');
4646

4747
return {
@@ -79,7 +79,7 @@ module.exports = {
7979
const paths = generateAbsolutePaths({netlifyConfig, inputs});
8080

8181
const success = await utils.cache.save(paths.absolute.buildDir, {
82-
digest: [paths.absolute.manifest]
82+
digests: [paths.absolute.manifest]
8383
});
8484

8585
if (success) {

0 commit comments

Comments
 (0)