Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import PouchDB from 'pouchdb-browser';
import PouchFind from 'pouchdb-find';
//import PouchSearch from 'pouchdb-quick-search';
import RelationalPouch from 'relational-pouch';
PouchDB.plugin(PouchFind);
//PouchDB.plugin(PouchSearch);
PouchDB.plugin(RelationalPouch);
PouchDB.plugin(require('pouchdb-debug').default);
window.PouchDB = PouchDB;
window.session_db = new PouchDB('session');
if (!window.rapyd_config) window.rapyd_config = {};
if (!window.localStorage.rapyd_server_url) {
if (window.rapyd_config.url) {
window.localStorage.rapyd_server_url = window.rapyd_config.url;
}
else if (window.location.protocol === 'file:') {
window.localStorage.rapyd_server_url = 'http://localhost:8069';
}
else {
window.localStorage.rapyd_server_url = ((href) => href.substring(0, href.lastIndexOf('/')) + '/')(window.location.origin + window.location.pathname);
}
}