• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SignpostMarv / JSON-Schema-TypeScript-CodeGen / 19434745916

17 Nov 2025 03:11PM UTC coverage: 99.427% (-0.6%) from 100.0%
19434745916

push

github

SignpostMarv
increasing coverage

639 of 649 branches covered (98.46%)

Branch coverage included in aggregate %.

9256 of 9303 relevant lines covered (99.49%)

210.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.08
/src/JSONSchema/Unknown.ts
1
import type {
19✔
2
        Expression,
19✔
3
        KeywordTypeNode,
19✔
4
} from 'typescript';
19✔
5
import {
19✔
6
        SyntaxKind,
19✔
7
} from 'typescript';
19✔
8

19✔
9
import type {
19✔
10
        SchemaDefinitionDefinition,
19✔
11
        SchemalessTypeOptions,
19✔
12
} from './Type.ts';
19✔
13
import {
19✔
14
        Type,
19✔
15
} from './Type.ts';
19✔
16

19✔
17
import type {
19✔
18
        SchemaParser,
19✔
19
// eslint-disable-next-line imports/no-relative-parent-imports
19✔
20
} from '../SchemaParser.ts';
19✔
21

19✔
22
import {
19✔
23
        factory,
19✔
24
// eslint-disable-next-line imports/no-relative-parent-imports
19✔
25
} from '../typescript/factory.ts';
19✔
26

19✔
27
type unknown_type = {
19✔
28
        type: 'object',
19✔
29
        additionalProperties: false,
19✔
30
        maxProperties: 0,
19✔
31
};
19✔
32

19✔
33
type unknown_schema = SchemaDefinitionDefinition<
19✔
34
        readonly ['type', 'additionalProperties', 'maxProperties'],
19✔
35
        {
19✔
36
                type: {
19✔
37
                        type: 'string',
19✔
38
                        const: 'object',
19✔
39
                },
19✔
40
                additionalProperties: {
19✔
41
                        type: 'boolean',
19✔
42
                        const: false,
19✔
43
                },
19✔
44
                maxProperties: {
19✔
45
                        type: 'integer',
19✔
46
                        const: 0,
19✔
47
                },
19✔
48
        }
19✔
49
>;
19✔
50

19✔
51
class Unknown extends Type<
19✔
52
        unknown,
19✔
53
        unknown_type,
19✔
54
        Record<string, never>,
19✔
55
        unknown_schema,
19✔
56
        Record<string, never>,
19✔
57
        KeywordTypeNode<SyntaxKind.UnknownKeyword>,
19✔
58
        Expression
19✔
59
> {
19✔
60
        constructor(options: SchemalessTypeOptions) {
19✔
61
                super({
2✔
62
                        ...options,
2✔
63
                        schema_definition: {},
2✔
64
                        type_definition: {},
2✔
65
                });
2✔
66
        }
2✔
67

19✔
68
        generate_typescript_data(
19✔
69
                data: unknown,
×
70
                schema_parser: SchemaParser,
×
71
                schema: unknown_type,
×
72
        ): Expression {
×
73
                const maybe = schema_parser.parse_by_type<
×
74
                        Exclude<Type<unknown>, Unknown>
×
75
                >(
×
76
                        data,
×
77
                        (maybe: unknown) => Type.is_a(maybe) && !Unknown.is_a(maybe),
×
78
                );
×
79

×
80
                return maybe.generate_typescript_data(data, schema_parser, schema);
×
81
        }
×
82

19✔
83
        generate_typescript_type() {
19✔
84
                return Promise.resolve(
1✔
85
                        factory.createKeywordTypeNode(SyntaxKind.UnknownKeyword),
1✔
86
                );
1✔
87
        }
1✔
88

19✔
89
        static generate_schema_definition() {
19✔
90
                return Object.freeze({
2✔
91
                        type: 'object',
2✔
92
                        required: ['type', 'additionalProperties', 'maxProperties'],
2✔
93
                        additionalProperties: false,
2✔
94
                        properties: {
2✔
95
                                type: {
2✔
96
                                        type: 'string',
2✔
97
                                        const: 'object',
2✔
98
                                },
2✔
99
                                additionalProperties: {
2✔
100
                                        type: 'boolean',
2✔
101
                                        const: false,
2✔
102
                                },
2✔
103
                                maxProperties: {
2✔
104
                                        type: 'integer',
2✔
105
                                        const: 0,
2✔
106
                                },
2✔
107
                        },
2✔
108
                } as const);
2✔
109
        }
2✔
110

19✔
111
        static generate_type_definition(): Readonly<unknown_type> {
19✔
112
                return Object.freeze({
2✔
113
                        type: 'object',
2✔
114
                        additionalProperties: false,
2✔
115
                        maxProperties: 0,
2✔
116
                });
2✔
117
        }
2✔
118
}
19✔
119

19✔
120
export type {
19✔
121
        unknown_type,
19✔
122
};
19✔
123

19✔
124
export {
19✔
125
        Unknown,
19✔
126
};
19✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc