@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
16 lines (15 loc) • 505 B
JavaScript
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
import { hasComplexArrayItems } from "./has-complex-array-items.js";
const shouldRenderArrayItemComposition = (schema, composition) => {
if (!schema || !isArraySchema(schema)) {
return false;
}
const items = schema.items;
if (!items || typeof items !== "object" || !(composition in items)) {
return false;
}
return !hasComplexArrayItems(schema);
};
export {
shouldRenderArrayItemComposition
};