Skip to content

Commit

Permalink
Fix false checks for booleans.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Sep 11, 2023
1 parent a4ead57 commit b926ef9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/openapi-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class OpenApiExplorer extends LitElement {
collapsed: {
type: Boolean, attribute: 'collapse',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},
operationsCollapsed: { type: Boolean },
Expand All @@ -68,7 +68,7 @@ export default class OpenApiExplorer extends LitElement {
displaySchemaAsTable: {
type: Boolean, attribute: 'table',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},
schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },
Expand All @@ -81,32 +81,32 @@ export default class OpenApiExplorer extends LitElement {
hideAuthentication: {
type: Boolean, attribute: 'hide-authentication',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},
allowTry: { type: String, attribute: 'enable-console' },
includeNulls: {
type: Boolean, attribute: 'display-nulls',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},
hideSearch: {
type: Boolean, attribute: 'hide-search',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},
hideServerSelection: {
type: Boolean, attribute: 'hide-server-selection',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},
hideComponents: {
type: Boolean, attribute: 'hide-components',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},

Expand All @@ -127,7 +127,7 @@ export default class OpenApiExplorer extends LitElement {
usePathInNavBar: {
type: Boolean, attribute: 'use-path-in-nav-bar',
converter(value) {
return value === 'false' ? false : value;
return value !== 'false' && value !== false;
}
},

Expand Down

0 comments on commit b926ef9

Please sign in to comment.