Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

if opts is string, then it's just filename and json is false

  • Loading branch information...
commit 61631d19140bcdb750e1da5f0ad7b23f74f84755 1 parent ffadf5c
@pkrumins authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/store.js
View
9 lib/store.js
@@ -4,10 +4,17 @@ var EventEmitter = require('events').EventEmitter;
module.exports = Store;
Store.prototype = new EventEmitter;
function Store(opts, cb) {
- if (!(this instanceof Store)) return new Store(filename, cb);
+ if (!(this instanceof Store)) return new Store(opts, cb);
if (cb === undefined) cb = function () {};
var self = this;
+ if (typeof opts === 'string') {
+ var opts = {
+ filename : opts,
+ json : false
+ }
+ }
+
if (opts.filename === undefined)
throw new Error('Filename was not specified');
Please sign in to comment.
Something went wrong with that request. Please try again.