fix: fix passing boolean value to showExtensions options (#1211)

Co-authored-by: Alef <aleksey.pavlov@corp.mail.ru>
This commit is contained in:
GreenHedgehog 2020-03-20 15:37:22 +03:00 committed by GitHub
parent afc7a95f13
commit c6eaa0281b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,11 +112,18 @@ export class RedocNormalizedOptions {
return true;
}
if (typeof value === 'string') {
return value.split(',').map(ext => ext.trim());
if (typeof value !== 'string') {
return value
}
return value;
switch (value) {
case 'true':
return true
case 'false':
return false
default:
return value.split(',').map(ext => ext.trim());
}
}
static normalizePayloadSampleIdx(value: RedocRawOptions['payloadSampleIdx']): number {