Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!snapshotJSON) {
return null
}
const {
version,
state,
timestamp: timestampString,
compatibilityChecksum,
} = JSON.parse(snapshotJSON as string)
return {
version,
state,
timestamp: coreutils.toTimestamp(timestampString),
compatibilityChecksum,
}
} catch (error) {
if (error.code !== 'NoSuchKey') {
throw error
}
return null
}
}
const data = snapshot.data()
if (!data) {
return null
}
const {
version,
state,
timestamp: timestampString,
compatibilityChecksum,
} = JSON.parse((await zipper.unzip(data.data)) as string)
return {
version,
state,
timestamp: utils.toTimestamp(timestampString),
compatibilityChecksum,
}
} catch (e) {
return null
}
}
public deleteSnapshots(): Promise {