Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function writeSave(command: WriteSaveCommand) {
const injector = progressReporter(onProgress);
try {
const data = writeSaveGame(command.saveGame, injector);
postMessage(writeSaveSuccess(data));
} catch (e) {
postMessage(writeSaveError(e));
}
}
function writeSave(command: WriteSaveCommand) {
const injector = progressReporter(onProgress);
try {
const data = writeSaveGame(command.saveGame, injector);
postMessage(writeSaveSuccess(data));
} catch (e) {
postMessage(writeSaveError(e));
}
}
function doSave(data: SaveCommandData) {
try {
const buffer = writeSaveGame(data.save);
const msg: DataSavedEvent = {
type: "saved",
buffer
};
postMessage(msg);
} catch (e) {
const msg: DataSavedEvent = {
type: "saved",
error: e,
buffer: null
};
postMessage(msg);
}
}