src/Resource.ts
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 17
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 0
eloc 12
mnd 0
bc 0
fnc 0
dl 0
loc 17
ccs 3
cts 4
cp 0.75
bpm 0
cpm 0
noi 0
c 0
b 0
f 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