random-access-storage
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -235,4 +235,4 @@ const EventEmitter = require('events') | ||
const ra = this.storage | ||
if (ra.opened && !ra.closed) return true | ||
if (!ra.opened) nextTick(this, this._openError || new Error('Not opened')) | ||
if (ra.opened && !ra.closed && !ra.suspended) return true | ||
if (!ra.opened || ra.suspended) nextTick(this, this._openError || new Error('Not opened')) | ||
else if (ra.closed) nextTick(this, new Error('Closed')) | ||
@@ -239,0 +239,0 @@ return false |
{ | ||
"name": "random-access-storage", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Easily make random-access-storage instances", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -73,3 +73,3 @@ # random-access-storage | ||
close: fn, // sets ._close | ||
destroy: fn // sets ._destroy | ||
unlink: fn // sets ._unlink | ||
} | ||
@@ -102,6 +102,2 @@ ``` | ||
#### `storage.suspendable` | ||
True if the storage implements `._suspend`. | ||
#### `storage.closed` | ||
@@ -111,6 +107,10 @@ | ||
#### `storage.destroyed` | ||
#### `storage.unlinked` | ||
True is the destorage has been fully destroyed. | ||
True if the storage has been fully unlinked. | ||
#### `storage.writing` | ||
True if the storage is currently being written to. | ||
#### `storage.on('open')` | ||
@@ -124,5 +124,5 @@ | ||
#### `storage.on('destroy')` | ||
#### `storage.on('unlink')` | ||
Emitted when the storage is fully destroyed. | ||
Emitted when the storage is fully unlinked. | ||
@@ -256,11 +256,11 @@ #### `storage.on('suspend')` | ||
#### `storage.destroy([callback])` | ||
#### `storage.unlink([callback])` | ||
Destroy the storage instance, removing all underlying data. | ||
Unlink the storage instance, removing all underlying data. | ||
#### `storage._destroy(req)` | ||
#### `storage._unlink(req)` | ||
Implement storage destroy. | ||
Implement storage unlink. | ||
Call `req.callback(err)` when the storage has been fully destroyed. | ||
Call `req.callback(err)` when the storage has been fully unlinked. | ||
@@ -267,0 +267,0 @@ Note this is guaranteed to run after `.close()` has been called and no methods will be run after. |
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
16290