mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
finalize new media settings ui
This commit is contained in:
@@ -223,3 +223,10 @@ export function omitSchema<Given extends JSONSchema>(_schema: Given, keys: strin
|
||||
export function isTypeSchema(schema?: JSONSchema): schema is Exclude<JSONSchema, boolean> {
|
||||
return typeof schema === "object" && "type" in schema && !isType(schema.type, "error");
|
||||
}
|
||||
|
||||
export function enumToOptions(_enum: any) {
|
||||
if (!Array.isArray(_enum)) return [];
|
||||
return _enum.map((v, i) =>
|
||||
typeof v === "string" ? { value: v, label: v } : { value: i, label: v }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user