abstract-leveldown
Advanced tools
Comparing version 0.7.3 to 0.7.4
{ | ||
"name" : "abstract-leveldown" | ||
, "description" : "An abstract prototype matching the LevelDOWN API" | ||
, "version" : "0.7.3" | ||
, "version" : "0.7.4" | ||
, "homepage" : "https://github.com/rvagg/node-abstract-leveldown" | ||
@@ -36,2 +36,5 @@ , "contributors" : [ | ||
} | ||
, "browser" : { | ||
"rimraf" : false | ||
} | ||
, "scripts": { | ||
@@ -38,0 +41,0 @@ "test" : "node ./test.js" |
const path = require('path') | ||
, fs = require('fs') | ||
, rimraf = require('rimraf') | ||
, fs = process.title != 'browser' && require('fs') | ||
, rimraf = process.title != 'browser' && require('rimraf') | ||
@@ -16,21 +16,23 @@ var dbidx = 0 | ||
, cleanup = function (callback) { | ||
fs.readdir(__dirname, function (err, list) { | ||
if (err) return callback(err) | ||
if (process.title != 'browser') { | ||
fs.readdir(__dirname, function (err, list) { | ||
if (err) return callback(err) | ||
list = list.filter(function (f) { | ||
return (/^_leveldown_test_db_/).test(f) | ||
}) | ||
list = list.filter(function (f) { | ||
return (/^_leveldown_test_db_/).test(f) | ||
}) | ||
if (!list.length) | ||
return callback() | ||
if (!list.length) | ||
return callback() | ||
var ret = 0 | ||
var ret = 0 | ||
list.forEach(function (f) { | ||
rimraf(path.join(__dirname, f), function (err) { | ||
if (++ret == list.length) | ||
callback() | ||
list.forEach(function (f) { | ||
rimraf(path.join(__dirname, f), function (err) { | ||
if (++ret == list.length) | ||
callback() | ||
}) | ||
}) | ||
}) | ||
}) | ||
} | ||
} | ||
@@ -37,0 +39,0 @@ |
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
87570
1944