1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Minor CLI bug fixes and improvements

This commit is contained in:
Laurent Cozic
2017-07-26 22:07:27 +01:00
parent 76a9264239
commit 89f1d5e6e7
10 changed files with 113 additions and 38 deletions

View File

@@ -134,7 +134,12 @@ class Setting extends BaseModel {
const md = this.settingMetadata(key);
if (md.type == Setting.TYPE_INT) return Math.floor(Number(value));
if (md.type == Setting.TYPE_BOOL) {
if (typeof value === 'string') value = Number(value);
if (typeof value === 'string') {
value = value.toLowerCase();
if (value === 'true') return true;
if (value === 'false') return false;
value = Number(value);
}
return !!value;
}
return value;