UNPKG

@aws-amplify/datastore

Version:

AppSyncLocal support for aws-amplify

1 lines 937 B
{"version":3,"file":"index.mjs","sources":["../../../../../src/storage/adapter/getDefaultAdapter/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isBrowser, isWebWorker } from '@aws-amplify/core/internals/utils';\nimport IndexedDBAdapter from '../IndexedDBAdapter';\n// eslint-disable-next-line import/no-named-as-default\nimport AsyncStorageAdapter from '../AsyncStorageAdapter';\nconst getDefaultAdapter = () => {\n if ((isBrowser && window.indexedDB) || (isWebWorker() && self.indexedDB)) {\n return IndexedDBAdapter;\n }\n return AsyncStorageAdapter;\n};\nexport default getDefaultAdapter;\n"],"names":[],"mappings":";;;;AAAA;AACA;AAKK,MAAC,iBAAiB,GAAG,MAAM;AAChC,IAAI,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,MAAM,WAAW,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE;AAC9E,QAAQ,OAAO,gBAAgB;AAC/B,IAAI;AACJ,IAAI,OAAO,mBAAmB;AAC9B;;;;"}