Skip to content

Commit

Permalink
feat: enable menuToggle by default
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Dec 12, 2019
1 parent 4bb59d5 commit 5d81abe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/RedocNormalizedOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export interface RedocRawOptions {
expandDefaultServerVariables?: boolean;
}

function argValueToBoolean(val?: string | boolean): boolean {
function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean {
if (val === undefined) {
return false;
return defaultValue || false;
}
if (typeof val === 'string') {
return true;
return val === 'false' ? false : true;
}
return val;
}
Expand Down Expand Up @@ -177,7 +177,7 @@ export class RedocNormalizedOptions {
this.onlyRequiredInSamples = argValueToBoolean(raw.onlyRequiredInSamples);
this.showExtensions = RedocNormalizedOptions.normalizeShowExtensions(raw.showExtensions);
this.hideSingleRequestSampleTab = argValueToBoolean(raw.hideSingleRequestSampleTab);
this.menuToggle = argValueToBoolean(raw.menuToggle);
this.menuToggle = argValueToBoolean(raw.menuToggle, true);
this.jsonSampleExpandLevel = RedocNormalizedOptions.normalizeJsonSampleExpandLevel(
raw.jsonSampleExpandLevel,
);
Expand Down

0 comments on commit 5d81abe

Please sign in to comment.