push
github
0 of 45 branches covered (0.0%)
Branch coverage included in aggregate %.
0 of 6 new or added lines in 2 files covered. (0.0%)
177 existing lines in 5 files now uncovered.0 of 7338 relevant lines covered (0.0%)
0.0 hits per line
| 1 |
import type {
|
|
| 2 |
Ajv2020 as Ajv, |
× |
| 3 |
} from 'ajv/dist/2020.js'; |
× |
| 4 |
|
× |
| 5 |
import {
|
× |
| 6 |
PropertySchemaToRegex, |
× |
| 7 |
} from '../Object.ts'; |
× |
| 8 |
|
× |
| 9 |
export function ConstString(
|
× |
| 10 |
ajv: Ajv, |
× |
| 11 |
) {
|
× |
| 12 |
return new PropertySchemaToRegex<{type: 'string', const: string}>( |
× |
| 13 |
ajv.compile({
|
× |
| 14 |
type: 'object', |
× |
| 15 |
additionalProperties: false,
|
× |
| 16 |
required: ['type', 'const'], |
× |
| 17 |
properties: {
|
× |
| 18 |
type: {
|
× |
| 19 |
type: 'string', |
× |
| 20 |
const: 'string', |
× |
| 21 |
}, |
× |
| 22 |
const: {
|
× |
| 23 |
type: 'string', |
× |
| 24 |
}, |
× |
| 25 |
}, |
× |
| 26 |
}), |
× |
| 27 |
(value) => {
|
× |
| 28 |
return `(?:${ |
× |
| 29 |
RegExp.escape(value.const)
|
× |
| 30 |
}|${
|
× |
| 31 |
RegExp.escape(`"${value.const}"`) |
× |
|
UNCOV
32
|
})`;
|
× |
|
UNCOV
33
|
}, |
× |
|
UNCOV
34
|
); |
× |
|
UNCOV
35
|
} |
× |