@serverless-rewrite/serverless
Version:
Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more
18 lines (14 loc) • 443 B
JavaScript
;
const fileExists = require('./fs/fileExists');
const readFile = require('./fs/readFile');
const getCacheFilePath = require('./getCacheFilePath');
const getCacheFile = async function (serviceDir) {
const cacheFilePath = getCacheFilePath(serviceDir);
return fileExists(cacheFilePath).then((exists) => {
if (!exists) {
return false;
}
return readFile(cacheFilePath);
});
};
module.exports = getCacheFile;