From c6eaa0281bb0f62b019c865e4aefb863ce84d628 Mon Sep 17 00:00:00 2001 From: GreenHedgehog Date: Fri, 20 Mar 2020 15:37:22 +0300 Subject: [PATCH] fix: fix passing boolean value to showExtensions options (#1211) Co-authored-by: Alef --- src/services/RedocNormalizedOptions.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/services/RedocNormalizedOptions.ts b/src/services/RedocNormalizedOptions.ts index 282f4eb1..219ad286 100644 --- a/src/services/RedocNormalizedOptions.ts +++ b/src/services/RedocNormalizedOptions.ts @@ -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 {