chore(oas): [16/n] improve oas schemas (#9272)
- Improve OAS schemas [16/n] - fixes and improvements to docs-generator tool
This commit is contained in:
16
www/utils/packages/docs-generator/src/utils/level-utils.ts
Normal file
16
www/utils/packages/docs-generator/src/utils/level-utils.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
type IncrementType = "array" | "allOf" | "anyOf" | "oneOf" | "object"
|
||||
|
||||
export function maybeIncrementLevel(
|
||||
level: number,
|
||||
type: IncrementType
|
||||
): number {
|
||||
if (type !== "object") {
|
||||
return level
|
||||
}
|
||||
|
||||
return level + 1
|
||||
}
|
||||
|
||||
export function isLevelExceeded(level: number, maxLevel: number) {
|
||||
return level > maxLevel
|
||||
}
|
||||
Reference in New Issue
Block a user