Skip to content

Commit 61e1bdd

Browse files
committed
added helpful error throw
1 parent ed69af4 commit 61e1bdd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/database.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function Database(filenameGiven, options) {
2525
if (typeof options !== 'object' || options === null) {
2626
options = {};
2727
}
28+
if ('readOnly' in options) {
29+
throw new TypeError('Misspelled option "readOnly" should be "readonly"');
30+
}
2831
var memory = util.getBooleanOption(options, 'memory');
2932
var readonly = util.getBooleanOption(options, 'readonly');
3033
var fileMustExist = util.getBooleanOption(options, 'fileMustExist');

0 commit comments

Comments
 (0)