mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 13:20:19 +03:00
simplify exclusive checks
This commit is contained in:
parent
2ac7ffa7f6
commit
515061166e
|
@ -428,10 +428,8 @@ export function humanizeNumberRange(schema: OpenAPISchema): string | undefined {
|
||||||
typeof schema.exclusiveMaximum === 'number'
|
typeof schema.exclusiveMaximum === 'number'
|
||||||
? Math.max(schema.exclusiveMaximum, schema.maximum ?? 0)
|
? Math.max(schema.exclusiveMaximum, schema.maximum ?? 0)
|
||||||
: schema.maximum;
|
: schema.maximum;
|
||||||
const exclusiveMinimum =
|
const exclusiveMinimum = typeof schema.exclusiveMinimum === 'number' || schema.exclusiveMinimum;
|
||||||
typeof schema.exclusiveMinimum === 'number' ? true : schema.exclusiveMinimum;
|
const exclusiveMaximum = typeof schema.exclusiveMaximum === 'number' || schema.exclusiveMaximum;
|
||||||
const exclusiveMaximum =
|
|
||||||
typeof schema.exclusiveMaximum === 'number' ? true : schema.exclusiveMaximum;
|
|
||||||
|
|
||||||
if (minimum !== undefined && maximum !== undefined) {
|
if (minimum !== undefined && maximum !== undefined) {
|
||||||
return `${exclusiveMinimum ? '( ' : '[ '}${minimum} .. ${maximum}${
|
return `${exclusiveMinimum ? '( ' : '[ '}${minimum} .. ${maximum}${
|
||||||
|
|
Loading…
Reference in New Issue
Block a user