Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function read(filename: string) {
let content = fs.readFileSync(filename)
let jsonString = zlib.gunzipSync(content)
return JSON.parse(jsonString.toString())
}
export function getContentSync(key: RepositoryKey): Buffer {
let data: Buffer;
for (const P in REPOSITORY) {
if (P === key) {
data = REPOSITORY[P];
break;
}
}
if (data) {
return ZLib.gunzipSync(data);
}
return data;
}
export function getContentSync(key: RepositoryKey): Buffer {
let data: Buffer;
for (const P in REPOSITORY) {
if (P === key) {
data = REPOSITORY[P];
break;
}
}
if (data) {
return ZLib.gunzipSync(data);
}
return data;
}