Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getValue(key) {
validateGetValueParams(key);
await this.initializationPromise;
try {
const result = await this._handleFile(key, readFilePromised);
return result
? parseBody(result.returnValue, mime.getType(result.fileName))
: null;
} catch (err) {
throw new Error(`Error reading file '${key}' in directory '${this.localStoragePath}' referred by ${ENV_VARS.LOCAL_STORAGE_DIR} environment variable: ${err.message}`); // eslint-disable-line
}
}