push
github
93 of 112 branches covered (83.04%)
Branch coverage included in aggregate %.
855 of 912 relevant lines covered (93.75%)
13.43 hits per line
| 1 |
/* Copyright (c) 2021-2023 Richard Rodger, MIT License */
|
|
| 2 |
|
1✔ |
| 3 |
|
1✔ |
| 4 |
import { Jsonic, Rule, Context } from '@jsonic/jsonic-next'
|
1✔ |
| 5 |
|
1✔ |
| 6 |
import {
|
1✔ |
| 7 |
MultiSourceOptions, |
1✔ |
| 8 |
Processor, |
1✔ |
| 9 |
Resolution, |
1✔ |
| 10 |
} from '../multisource' |
1✔ |
| 11 |
|
1✔ |
| 12 |
|
1✔ |
| 13 |
function makeJsonicProcessor(): Processor {
|
|
| 14 |
|
1✔ |
| 15 |
return function JsonicProcessor(
|
|
| 16 |
res: Resolution, |
55✔ |
| 17 |
_popts: MultiSourceOptions, |
55✔ |
| 18 |
_rule: Rule, |
55✔ |
| 19 |
ctx: Context, |
55✔ |
| 20 |
jsonic: Jsonic |
55✔ |
| 21 |
) {
|
55✔ |
| 22 |
if (null != res.src && null != res.full) {
|
55✔ |
| 23 |
res.val = jsonic(res.src, ctx.meta) |
55✔ |
| 24 |
} |
55✔ |
| 25 |
} |
55✔ |
| 26 |
} |
1✔ |
| 27 |
|
1✔ |
| 28 |
|
1✔ |
| 29 |
|
1✔ |
| 30 |
export {
|
× |
| 31 |
makeJsonicProcessor |
× |
| 32 |
} |
× |