@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) • 614 B
text/typescript
import { InvalidRouteParamValue, RouteParam } from '@prefecthq/vue-compositions'
import { LocationQueryValue } from 'vue-router'
import { FlowSortValues, isFlowSortValue } from '@/types/SortOptionTypes'
export class FlowSortValuesSortParam extends RouteParam<FlowSortValues> {
protected parse(value: LocationQueryValue): FlowSortValues {
if (isFlowSortValue(value)) {
return value
}
throw new InvalidRouteParamValue()
}
protected format(value: FlowSortValues): LocationQueryValue {
if (isFlowSortValue(value)) {
return value
}
throw new InvalidRouteParamValue()
}
}