mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
introduced 'autoFixConsistencyIssues' option to control whether consistency issues should be auto fixed or note
This commit is contained in:
@@ -10,6 +10,9 @@ async function getOption(name) {
|
||||
return option.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Promise<number>}
|
||||
*/
|
||||
async function getOptionInt(name) {
|
||||
const val = await getOption(name);
|
||||
|
||||
@@ -22,6 +25,19 @@ async function getOptionInt(name) {
|
||||
return intVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
async function getOptionBool(name) {
|
||||
const val = await getOption(name);
|
||||
|
||||
if (!['true', 'false'].includes(val)) {
|
||||
throw new Error(`Could not parse "${val}" into boolean for option "${name}"`);
|
||||
}
|
||||
|
||||
return val === 'true';
|
||||
}
|
||||
|
||||
async function setOption(name, value) {
|
||||
const option = await require('./repository').getOption(name);
|
||||
|
||||
@@ -64,6 +80,7 @@ async function getOptionsMap(allowedOptions) {
|
||||
module.exports = {
|
||||
getOption,
|
||||
getOptionInt,
|
||||
getOptionBool,
|
||||
setOption,
|
||||
createOption,
|
||||
getOptions,
|
||||
|
||||
Reference in New Issue
Block a user