Skip to content

Commit

Permalink
fix: fix passing boolean value to showExtensions options (#1211)
Browse files Browse the repository at this point in the history
Co-authored-by: Alef <aleksey.pavlov@corp.mail.ru>
  • Loading branch information
GreenHedgehog and Alef authored Mar 20, 2020
1 parent afc7a95 commit c6eaa02
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/services/RedocNormalizedOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c6eaa02

Please sign in to comment.