random-access-storage
Advanced tools
Comparing version
11
index.js
var events = require('events') | ||
var inherits = require('inherits') | ||
var queueTick = require('queue-tick') | ||
@@ -85,3 +86,3 @@ var NOT_READABLE = defaultImpl(new Error('Not readable')) | ||
if (!cb) cb = noop | ||
if (this.opened && !this._needsOpen) return process.nextTick(cb, null) | ||
if (this.opened && !this._needsOpen) return queueTick(() => cb(null)) | ||
queueAndRun(this, new Request(this, OPEN_OP, 0, 0, null, cb)) | ||
@@ -95,3 +96,3 @@ } | ||
if (!cb) cb = noop | ||
if (this.closed) return process.nextTick(cb, null) | ||
if (this.closed) return queueTick(() => cb(null)) | ||
queueAndRun(this, new Request(this, CLOSE_OP, 0, 0, null, cb)) | ||
@@ -270,7 +271,3 @@ } | ||
function nextTick (req, err, val) { | ||
process.nextTick(nextTickCallback, req, err, val) | ||
queueTick(() => req.callback(err, val)) | ||
} | ||
function nextTickCallback (req, err, val) { | ||
req.callback(err, val) | ||
} |
{ | ||
"name": "random-access-storage", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Easily make random-access-storage instances", | ||
"main": "index.js", | ||
"dependencies": { | ||
"inherits": "^2.0.3" | ||
"inherits": "^2.0.3", | ||
"queue-tick": "^1.0.0" | ||
}, | ||
@@ -9,0 +10,0 @@ "devDependencies": { |
@@ -9,4 +9,2 @@ # random-access-storage | ||
[](https://travis-ci.org/random-access-storage/random-access-storage) | ||
A random-access-storage instance is a common interface for a storage abstraction, that provides the following core api. | ||
@@ -13,0 +11,0 @@ |
25045
1.02%2
100%629
-0.32%233
-0.85%+ Added
+ Added