Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(clientOptions?: OffixClientConfig) {
if (clientOptions && clientOptions.storage) {
this.cacheStorage = clientOptions.storage;
this.offlineStorage = clientOptions.storage;
} else {
this.cacheStorage = createDefaultCacheStorage();
this.offlineStorage = createDefaultOfflineStorage();
}
this.networkStatus = (isMobileCordova()) ?
new CordovaNetworkStatus() : new WebNetworkStatus();
if (clientOptions && clientOptions.conflictStrategy) {
this.conflictStrategy = clientOptions.conflictStrategy;
} else {
this.conflictStrategy = UseClient;
}
Object.assign(this, clientOptions);
}
}