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

satisfactory-dev / Docs.json.ts / 19762550657

28 Nov 2025 11:29AM UTC coverage: 0.0%. Remained the same
19762550657

push

github

SignpostMarv
restoring import of overrides

0 of 31 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 8 new or added lines in 2 files covered. (0.0%)

768 existing lines in 8 files now uncovered.

0 of 6463 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/src/version-specific/0.3.7.7/TypedString/Object.ts
1
import type {
×
2
        Ajv2020 as Ajv,
×
3
        ValidateFunction,
×
4
} from 'ajv/dist/2020.js';
×
5

×
6
import type {
×
7
        PropertyAssignment,
×
8
} from 'typescript';
×
9

×
10
import type {
×
11
        object_schema,
×
12
        object_type_base,
×
13
        object_TypeLiteralNode_possibly_extended,
×
14
        ObjectOfSchemas,
×
15
        SchemaObject,
×
16
        SchemaParser,
×
17
} from '@signpostmarv/json-schema-typescript-codegen';
×
18
import {
×
19
        ObjectUnspecified,
×
20
        Type,
×
21
} from '@signpostmarv/json-schema-typescript-codegen';
×
22

×
23
import {
×
24
        factory,
×
25
        type ObjectLiteralExpression,
×
26
} from '@signpostmarv/json-schema-typescript-codegen/typescript-overrides';
×
27

×
28
export type Object_type = object_type_base<
×
29
        'properties',
×
30
        SchemaObject,
×
31
        [string, ...string[]],
×
32
        ObjectOfSchemas,
×
33
        ObjectOfSchemas
×
34
>;
×
35

×
36
export type Object_properties = object_schema<'properties'>;
×
37

×
38
export type Object_DataTo = ObjectLiteralExpression;
×
39

×
40
export type Object_SchemaTo = object_TypeLiteralNode_possibly_extended<
×
41
        'properties'
×
42
>;
×
43

×
44
export type Object_TypeGenerator = (
×
45
        schema: object_type_base<
×
46
                'properties',
×
47
                SchemaObject,
×
48
                [string, ...string[]],
×
49
                ObjectOfSchemas,
×
50
                ObjectOfSchemas
×
51
        >,
×
52
        schema_parser: SchemaParser,
×
53
) => Promise<object_TypeLiteralNode_possibly_extended<'properties'>>;
×
54

×
55
export const Object_type_schema = Object.freeze({
×
56
        type: 'object',
×
57
        required: ['type'],
×
58
        properties: {
×
59
                type: {
×
60
                        type: 'string',
×
61
                        const: 'object',
×
62
                },
×
63
        },
×
64
});
×
65

×
66
export function Object_compile_validator(
×
67
        ajv: Ajv,
×
68
): ValidateFunction<Object_type> {
×
69
        return ajv.compile<
×
70
                Object_type
×
71
        >(
×
72
                Object_type_schema,
×
73
        );
×
74
}
×
75

×
76
export function Object_generate_typescript_data(
×
77
        data: string,
×
78
        schema_parser: SchemaParser,
×
79
        coerced_schema: Object_type,
×
80
        schema: SchemaObject,
×
81
): Object_DataTo {
×
82
        const properties = Object.keys(
×
83
                coerced_schema.properties,
×
84
        );
×
85

×
86
        const regex = new RegExp(`^\\((?:,?${properties.map(
×
87
                (property): [
×
88
                        string,
×
89
                        string,
×
90
                ] => [
×
91
                        property,
×
92
                        `(${RegExp.escape(property)})=([^=]+|\\(.+\\)(?=[,\\)]))`,
×
93
                ],
×
94
        ).map(([
×
95
                property,
×
96
                regex,
×
97
        ], i) => (
×
98
                (
×
99
                        coerced_schema.required || ([] as string[])
×
100
                ).includes(property)
×
101
                        ? `${i > 0 ? ',' : ''}${regex}`
×
102
                        : `(?:${i > 0 ? ',' : ''}${regex})?`
×
103
        )).join('')})*\\)$`);
×
104

×
105
        const match = regex.exec(data);
×
106

×
107
        if (null === match) {
×
108
                throw new TypeError('Data does not match expected regex!');
×
109
        }
×
110

×
111
        const [, ...matches] = match;
×
112

×
113
        const property_assignments: PropertyAssignment[] = [];
×
114

×
115
        for (let i = 0; i < matches.length; i += 2) {
×
116
                const property_name = matches[i];
×
117
                const property_value = matches[i + 1];
×
118

×
119
                if (
×
120
                        undefined === property_name
×
121
                        && undefined === property_value
×
122
                ) {
×
123
                        continue;
×
124
                }
×
125

×
126
                const property_schema = Type.maybe_add_$defs(
×
127
                        schema,
×
128
                        coerced_schema.properties[
×
129
                                property_name
×
130
                        ],
×
131
                );
×
132

×
133
                const type_for_property = schema_parser.parse(
×
134
                        property_schema,
×
135
                );
×
136

×
137
                const value = type_for_property
×
138
                        .generate_typescript_data(
×
139
                                property_value,
×
140
                                schema_parser,
×
141
                                property_schema,
×
142
                        );
×
143

×
144
                const property_assignment = factory
×
145
                        .createPropertyAssignment(
×
146
                                property_name,
×
147
                                value,
×
148
                        );
×
149

×
150
                property_assignments.push(property_assignment);
×
151
        }
×
152

×
153
        const sanity_check: Object_DataTo = factory
×
154
                .createObjectLiteralExpression(
×
155
                        property_assignments,
×
UNCOV
156
                        true,
×
UNCOV
157
                );
×
UNCOV
158

×
UNCOV
159
        return sanity_check;
×
UNCOV
160
}
×
UNCOV
161

×
UNCOV
162
export function Object_generate_typescript_type(
×
UNCOV
163
        schema: Object_type,
×
UNCOV
164
        schema_parser: SchemaParser,
×
UNCOV
165
): Promise<Object_SchemaTo> {
×
UNCOV
166
        const instance = schema_parser.types
×
UNCOV
167
                .find((maybe): maybe is ObjectUnspecified<
×
UNCOV
168
                        {[key: string]: unknown},
×
UNCOV
169
                        'properties'
×
UNCOV
170
                > => (
×
UNCOV
171
                        maybe instanceof ObjectUnspecified
×
UNCOV
172
                        && 'properties' === maybe.properties_mode
×
UNCOV
173
                ));
×
UNCOV
174

×
UNCOV
175
        if (undefined === instance) {
×
UNCOV
176
                throw new TypeError(`schema_parser not loaded with ${
×
UNCOV
177
                        ObjectUnspecified.constructor.name
×
UNCOV
178
                }<{[key: string]: unknown}, 'properties'>`);
×
UNCOV
179
        }
×
UNCOV
180

×
UNCOV
181
        return instance.generate_typescript_type({
×
UNCOV
182
                schema,
×
UNCOV
183
                schema_parser,
×
UNCOV
184
        });
×
UNCOV
185
}
×
UNCOV
186

×
UNCOV
187
export function Object_ajv_macro(
×
UNCOV
188
        schema: Object_type,
×
UNCOV
189
) {
×
UNCOV
190
        const regex = `${
×
UNCOV
191
                Object.keys(schema.properties)
×
UNCOV
192
                        .map((property) => `(?:,?${
×
UNCOV
193
                                RegExp.escape(property)
×
UNCOV
194
                        }=(?:${
×
UNCOV
195
                                `\\((?:,?[^=]+=(?:\\([^)]+\\)|\\d+))+\\)`
×
UNCOV
196
                        }|${
×
UNCOV
197
                                `\\([^=]+=\\([^)]+\\)\\)`
×
UNCOV
198
                        }|${
×
UNCOV
199
                                `\\([^)]+\\)`
×
UNCOV
200
                        }|${
×
UNCOV
201
                                `[^=]+`
×
UNCOV
202
                        }))${
×
UNCOV
203
                                (
×
UNCOV
204
                                        (schema.required || ([] as string[]))
×
UNCOV
205
                                                .includes(property)
×
UNCOV
206
                                )
×
UNCOV
207
                                        ? ''
×
UNCOV
208
                                        : '?'
×
UNCOV
209
                        }`)
×
UNCOV
210
                        .join('')
×
UNCOV
211
        }`;
×
UNCOV
212

×
UNCOV
213
        return Object.freeze({
×
UNCOV
214
                pattern: `^\\(${regex}(?:,${regex})*\\)$`,
×
UNCOV
215
        });
×
UNCOV
216
}
×
UNCOV
217

×
UNCOV
218
export function Object_generate_schema_definition(
×
UNCOV
219
): Readonly<Object_properties> {
×
UNCOV
220
        return ObjectUnspecified
×
UNCOV
221
                .generate_schema_definition({
×
UNCOV
222
                        properties_mode: 'properties',
×
UNCOV
223
                });
×
UNCOV
224
}
×
UNCOV
225

×
UNCOV
226
export function Object_generate_type_definition(
×
UNCOV
227
): Readonly<Object_type> {
×
UNCOV
228
        return ObjectUnspecified
×
UNCOV
229
                .generate_type_definition({
×
UNCOV
230
                        properties_mode: 'properties',
×
UNCOV
231
                        properties: {},
×
UNCOV
232
                });
×
UNCOV
233
}
×
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