From a162a0d6f5c0fde3969573fa6cc18cb91ddd9d47 Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Wed, 31 May 2017 15:45:14 +0100 Subject: [PATCH] [js] Couple of additional checks for module existence --- lib/modules/database/index.js | 4 ++-- lib/modules/storage/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/modules/database/index.js b/lib/modules/database/index.js index a33da609..ccd1df03 100644 --- a/lib/modules/database/index.js +++ b/lib/modules/database/index.js @@ -211,7 +211,7 @@ export default class Database extends Base { } export const statics = { - ServerValue: { + ServerValue: FirebaseDatabase ? { TIMESTAMP: FirebaseDatabase.serverValueTimestamp || { '.sv': 'timestamp' }, - }, + } : {}, }; diff --git a/lib/modules/storage/index.js b/lib/modules/storage/index.js index 863d4120..98013f22 100644 --- a/lib/modules/storage/index.js +++ b/lib/modules/storage/index.js @@ -148,7 +148,7 @@ export const statics = { CANCELLED: 'cancelled', ERROR: 'error', }, - Native: { + Native: FirebaseStorage ? { MAIN_BUNDLE_PATH: FirebaseStorage.MAIN_BUNDLE_PATH, CACHES_DIRECTORY_PATH: FirebaseStorage.CACHES_DIRECTORY_PATH, DOCUMENT_DIRECTORY_PATH: FirebaseStorage.DOCUMENT_DIRECTORY_PATH, @@ -158,5 +158,5 @@ export const statics = { LIBRARY_DIRECTORY_PATH: FirebaseStorage.LIBRARY_DIRECTORY_PATH, FILETYPE_REGULAR: FirebaseStorage.FILETYPE_REGULAR, FILETYPE_DIRECTORY: FirebaseStorage.FILETYPE_DIRECTORY, - }, + } : {}, };