@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_.
17 lines (16 loc) • 635 B
text/typescript
import { BlockTypeResponse } from '@/models/api/BlockTypeResponse'
import { BlockType } from '@/models/BlockType'
import { MapFunction } from '@/services/Mapper'
export const mapBlockTypeResponseToBlockType: MapFunction<BlockTypeResponse, BlockType> = function(source) {
return new BlockType({
id: source.id,
name: source.name,
slug: source.slug,
logoUrl: source.logo_url,
documentationUrl: source.documentation_url,
description: source.description,
codeExample: source.code_example,
created: this.map('string', source.created, 'Date'),
updated: this.map('string', source.updated, 'Date'),
})
}