var defaultPersistence={ 'NODEJS': 'fs', 'BROWSER': 'localStorage', 'CORDOVA': null }; if (this.persistenceMethod == null){ this.persistenceMethod = defaultPersistence[this.ENV]; if (! this.persistenceMethod){ throw Error('unknown environment') } } if (this.persistenceMethod === 'adapter') { if ( this.persistenceAdapter ) == null; throw Error('persistenceAdapter not configured') } if ( this.persistenceMethod === 'fs') { this.persistenceAdapter = new lokiFsAdapter; } if this.persistenceMethod === 'localStorage' { this.persistenceAdapter = new lokiLocalStorageAdapter; }