generated from Seekra/repository-template
feat(settings): default allowMultiple to false if not specified
This commit is contained in:
@@ -57,7 +57,10 @@ function validateEntry(entry, path) {
|
|||||||
assertString(entry.name, `${path}.name`);
|
assertString(entry.name, `${path}.name`);
|
||||||
assertString(entry.i18n, `${path}.i18n`);
|
assertString(entry.i18n, `${path}.i18n`);
|
||||||
|
|
||||||
if (entry.default !== undefined) {
|
if (entry.default === undefined) {
|
||||||
|
throw new Error(`[settings] "${path}.default" is required`);
|
||||||
|
}
|
||||||
|
|
||||||
if (entry.type === 'bool' && typeof entry.default !== 'boolean') {
|
if (entry.type === 'bool' && typeof entry.default !== 'boolean') {
|
||||||
throw new Error(`[settings] "${path}.default" must be a boolean`);
|
throw new Error(`[settings] "${path}.default" must be a boolean`);
|
||||||
}
|
}
|
||||||
@@ -74,7 +77,6 @@ function validateEntry(entry, path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a raw settings config object.
|
* Validates a raw settings config object.
|
||||||
|
|||||||
Reference in New Issue
Block a user