Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
db.collection(col).then(c => {
customMethods[c.name] = col.methods;
if (col.sync) {
if (col.sync.remote) {
col.sync.remote = new PouchDB(
col.sync.remote,
data.authorization
? {
headers: { Authorization: data.authorization }
}
: ({} as any)
);
}
replicationStates[c.name] = c.sync(col.sync);
}
return c;
})
)
db.collection(col).then((c: any) => {
this.customMethods[c.name] = col.methods;
if (col.sync) {
if (col.sync.remote) {
col.sync.remote = new PouchDB(
col.sync.remote,
data.authorization
? {
headers: { Authorization: data.authorization }
}
: ({} as any)
);
}
this.replicationStates[c.name] = c.sync(col.sync);
}
return c;
})
)