Skip to content

Commit 0bf6061

Browse files
EommUzlopak
andauthored
Apply suggestions from code review
Co-authored-by: Uzlopak <[email protected]>
1 parent eb40852 commit 0bf6061

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

standalone.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
const SerializerSelector = require('./index')
44

55
function StandaloneSerializer (options = { readMode: true }) {
6-
if (options.readMode === true && !options.restoreFunction) {
7-
throw new Error('You must provide a restoreFunction options when readMode ON')
6+
if (options.readMode === true && typeof options.restoreFunction !== 'function') {
7+
throw new Error('You must provide a function for the restoreFunction-option when readMode ON')
88
}
99

1010
if (options.readMode !== true && !options.storeFunction) {
11-
throw new Error('You must provide a storeFunction options when readMode OFF')
11+
throw new Error('You must provide a function for the restoreFunction-option when readMode OFF')
1212
}
1313

1414
if (options.readMode === true) {

0 commit comments

Comments
 (0)