fix: auto-increment setting parsing. (#453)

This commit is contained in:
Ahmed Bouhuolia
2024-05-17 12:49:04 +02:00
committed by GitHub
parent e380c598d3
commit 2ada57a2b4
4 changed files with 14 additions and 17 deletions

View File

@@ -337,6 +337,9 @@ const booleanValues: string[] = [
].map((value) => normalizeValue(value));
export const parseBoolean = <T>(value: any, defaultValue: T): T | boolean => {
if (typeof value === 'boolean') {
return value; // Retrun early we have nothing to parse.
}
const normalizedValue = normalizeValue(value);
if (isEmpty(value) || booleanValues.indexOf(normalizedValue) === -1) {
return defaultValue;