| Total Complexity | 0 |
| Complexity/F | 0 |
| Lines of Code | 17 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 75% |
| Changes | 0 | ||
| 1 | import * as t from 'io-ts'; |
||
| 2 | 1 | import {Lens} from 'monocle-ts'; |
|
| 3 | import {ResourceC} from './io/ResourceC'; |
||
| 4 | import {ResourceIdentifier} from './ResourceIdentifier'; |
||
| 5 | |||
| 6 | export interface Resource extends t.TypeOf<typeof ResourceC> { |
||
| 7 | } |
||
| 8 | |||
| 9 | 1 | export const Resource = { |
|
| 10 | lens: { |
||
| 11 | identifier: new Lens<Resource, ResourceIdentifier>( |
||
| 12 | 3 | ({type, id, ..._}) => ({type, id}), |
|
| 13 | ({type, id, ..._}) => s => ({...s, type, id}) |
||
| 14 | ) |
||
| 15 | } |
||
| 16 | }; |
||
| 17 |