Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tx.executeSql(sql, [], function (tx, result) {
var deleted = [];
var local = [];
for (var i = 0; i < result.rows.length; i++) {
var item = result.rows.item(i);
var seq = item.seq;
var metadata = JSON.parse(item.metadata);
if (isDeleted(metadata)) {
deleted.push(seq);
}
if (isLocalId(metadata.id)) {
local.push(metadata.id);
}
}
tx.executeSql('UPDATE ' + DOC_STORE + 'SET local = 1 WHERE id IN ' +
qMarks(local.length), local, function () {
tx.executeSql('UPDATE ' + BY_SEQ_STORE +
' SET deleted = 1 WHERE seq IN ' +
qMarks(deleted.length), deleted, callback);
});
});
});
function getIsDeleted(metadata, winningRev) {
return 'deleted' in metadata ?
metadata.deleted : pouchdbAdapterUtils.isDeleted(metadata, winningRev);
}
function getIsDeleted(metadata, winningRev) {
return 'deleted' in metadata ?
metadata.deleted : isDeleted(metadata, winningRev);
}
function getIsDeleted(metadata, winningRev) {
return 'deleted' in metadata ?
metadata.deleted : pouchdbAdapterUtils.isDeleted(metadata, winningRev);
}
function getIsDeleted(metadata, winningRev) {
return 'deleted' in metadata ?
metadata.deleted : isDeleted(metadata, winningRev);
}
function getIsDeleted (metadata, winningRev) {
return 'deleted' in metadata
? metadata.deleted
: isDeleted(metadata, winningRev)
}