How to use the @ddes/core.utils.toTimestamp function in @ddes/core

To help you get started, we’ve selected a few @ddes/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skalar / ddes / packages / @ddes / aws-store / lib / AwsSnapshotStore.ts View on Github external
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
    }
  }
github Skalar / ddes / packages / @ddes / firestore / lib / FirestoreSnapshotStore.ts View on Github external
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 {

@ddes/core

Event Sourcing in TypeScript

MIT
Latest version published 3 months ago

Package Health Score

65 / 100
Full package analysis