UNPKG

@prefecthq/prefect-ui-library

Version:

This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.

21 lines (17 loc) 572 B
import { Schema, SchemaProperties } from '@/types/schemas' import { mapEntries } from '@/utilities/object' function getSchemaPropertiesWithoutDefaults( schemaProperties: SchemaProperties = {}, ): SchemaProperties { return mapEntries(schemaProperties, (key, property) => { // eslint-disable-next-line no-unused-vars const { default: __, ...rest } = property return [key, rest] }) } export function getSchemaWithoutDefaults(schema: Schema): Schema { return { ...schema, properties: getSchemaPropertiesWithoutDefaults(schema.properties), } }