pouchdb-all-dbs
Advanced tools
Comparing version 0.1.6 to 1.0.0
@@ -56,5 +56,6 @@ #!/usr/bin/env node | ||
client.browser !== 'firefox' && | ||
client.browser !== 'phantomjs' && | ||
process.env.TRAVIS_SECURE_ENV_VARS === 'false') { | ||
console.error('Not running test, cannot connect to saucelabs'); | ||
process.exit(0); | ||
process.exit(1); | ||
return; | ||
@@ -61,0 +62,0 @@ } |
{ | ||
"name": "pouchdb-all-dbs", | ||
"main": "dist/pouchdb.all-dbs.js", | ||
"version": "0.1.6", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/nolanlawson/pouchdb-all-dbs", | ||
@@ -6,0 +6,0 @@ "authors": [ |
20
index.js
@@ -24,2 +24,3 @@ 'use strict'; | ||
var pouch; | ||
var cache; | ||
var queue = new TaskQueue(); | ||
@@ -77,2 +78,5 @@ | ||
}).then(function () { | ||
if (cache) { | ||
cache[dbName] = true; | ||
} | ||
callback(); | ||
@@ -99,2 +103,5 @@ }, callback); | ||
}).then(function () { | ||
if (cache) { | ||
delete cache[dbName]; | ||
} | ||
callback(); | ||
@@ -108,7 +115,15 @@ }, callback); | ||
queue.add(function (callback) { | ||
if (cache) { | ||
return callback(null, Object.keys(cache).map(unprefixed)); | ||
} | ||
// older versions of this module didn't have prefixes, so check here | ||
var opts = {startkey: PREFIX, endkey: (PREFIX + '\uffff')}; | ||
pouch.allDocs(opts).then(function (res) { | ||
var dbs = res.rows.map(function (row) { | ||
return unprefixed(row.key); | ||
cache = {}; | ||
var dbs = []; | ||
res.rows.forEach(function (row) { | ||
dbs.push(unprefixed(row.key)); | ||
cache[row.key] = true; | ||
}); | ||
@@ -127,2 +142,3 @@ callback(null, dbs); | ||
pouch = null; | ||
cache = null; | ||
callback(); | ||
@@ -129,0 +145,0 @@ }).catch(function (err) { |
{ | ||
"name": "pouchdb-all-dbs", | ||
"version": "0.1.6", | ||
"version": "1.0.0", | ||
"description": "PouchDB allDbs plugin", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
736985
21146
2