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 parseSave(command: ParseSaveCommand) {
const injector = progressReporter(onProgress);
try {
const save = parseSaveGame(command.data, injector);
postMessage(parseSaveSuccess(save));
} catch (e) {
postMessage(parseSaveError(e));
}
}