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