1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

CLI: Fixed shell mode

This commit is contained in:
Laurent Cozic
2017-12-07 18:12:46 +00:00
parent 37663bd110
commit ad6c347180
9 changed files with 98 additions and 29 deletions

View File

@ -165,6 +165,16 @@ class Database {
throw new Error('Unknown enum type or value: ' + type + ', ' + s);
}
static enumName(type, id) {
if (type === 'fieldType') {
if (id === Database.TYPE_UNKNOWN) return 'unknown';
if (id === Database.TYPE_INT) return 'int';
if (id === Database.TYPE_TEXT) return 'text';
if (id === Database.TYPE_NUMERIC) return 'numeric';
throw new Error('Invalid type id: ' + id);
}
}
static formatValue(type, value) {
if (value === null || value === undefined) return null;
if (type == this.TYPE_INT) return Number(value);