Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
): LocalDatabase {
if (isPlatformBrowser(platformId) && 'indexedDB' in window && indexedDB !== undefined && indexedDB !== null) {
// Try with IndexedDB in modern browsers
// CUSTOM: Use our own IndexedDB implementation
return new CustomIndexedDBDatabase(storagelock, prefix);
} else if (
isPlatformBrowser(platformId) &&
'localStorage' in window &&
localStorage !== undefined &&
localStorage !== null
) {
// Try with localStorage in old browsers (IE9)
return new LocalStorageDatabase(prefix);
} else {
// Fake database for server-side rendering (Universal)
return new MockLocalDatabase();
}
}