committed by
Vladimír Gorej
parent
7cfc5e3656
commit
f06c1caed5
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
export const upperFirst = (value) => {
|
||||
if (typeof value === "string") {
|
||||
return `${value.charAt(0).toUpperCase()}${value.slice(1)}`
|
||||
@@ -17,4 +16,16 @@ export const getTitle = (schema) => {
|
||||
return ""
|
||||
}
|
||||
|
||||
export const getType = (schema) => {
|
||||
if (Array.isArray(schema.type)) {
|
||||
return schema.type.map(String).join(" | ")
|
||||
}
|
||||
|
||||
if (schema.type != null) {
|
||||
return String(schema.type)
|
||||
}
|
||||
|
||||
return "any"
|
||||
}
|
||||
|
||||
export const isBooleanJSONSchema = (schema) => typeof schema === "boolean"
|
||||
|
||||
Reference in New Issue
Block a user