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_.

22 lines (17 loc) 686 B
import { InvalidRouteParamValue, RouteParam } from '@prefecthq/vue-compositions' import { LocationQueryValue } from 'vue-router' import { BlockDocumentSortValues, isBlockDocumentSortValue } from '@/types/SortOptionTypes' export class BlockDocumentSortValuesSortParam extends RouteParam<BlockDocumentSortValues> { protected parse(value: LocationQueryValue): BlockDocumentSortValues { if (isBlockDocumentSortValue(value)) { return value } throw new InvalidRouteParamValue() } protected format(value: BlockDocumentSortValues): LocationQueryValue { if (isBlockDocumentSortValue(value)) { return value } throw new InvalidRouteParamValue() } }