Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit f490deb

Browse files
author
Alan Shaw
committed
fix: config set with number
Anything that isn't a string needs to be passed with `--json`. fixes #881 License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent f4b89ed commit f490deb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/config/set.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ module.exports = (send) => {
1616
return callback(new Error('Invalid value type'))
1717
}
1818

19-
if (typeof value === 'object') {
20-
value = JSON.stringify(value)
21-
opts = { json: true }
22-
}
23-
2419
if (typeof value === 'boolean') {
2520
value = value.toString()
2621
opts = { bool: true }
22+
} else if (typeof value !== 'string') {
23+
value = JSON.stringify(value)
24+
opts = { json: true }
2725
}
2826

2927
send({

0 commit comments

Comments
 (0)