random-access-storage
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -31,3 +31,3 @@ const EventEmitter = require('events') | ||
this._needsOpen = true | ||
this._needsCreate = false | ||
this._needsCreate = !!opts.createAlways | ||
@@ -34,0 +34,0 @@ this.opened = false |
{ | ||
"name": "random-access-storage", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Easily make random-access-storage instances", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -64,4 +64,4 @@ # random-access-storage | ||
{ | ||
createAlways: false, // always create storage on first open | ||
open: fn, // sets ._open | ||
openReadonly: fn, // sets ._openReadonly | ||
read: fn, // sets ._read | ||
@@ -68,0 +68,0 @@ write: fn, // sets ._write |
15
test.js
@@ -485,1 +485,16 @@ const test = require('brittle') | ||
}) | ||
test('create always', function (t) { | ||
t.plan(1) | ||
const s = new RAS({ | ||
createAlways: true, | ||
open: function (req) { | ||
t.ok(req.create) | ||
req.callback(null) | ||
} | ||
}) | ||
s.open() | ||
}) |
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
25059
667