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

satisfactory-dev / Docs.json.ts / 20385899622

20 Dec 2025 12:10AM UTC coverage: 0.0%. Remained the same
20385899622

push

github

SignpostMarv
adjusting indentation

0 of 53 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 11 new or added lines in 1 file covered. (0.0%)

230 existing lines in 15 files now uncovered.

0 of 9104 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.8.3.3/TypedString.ts
1
import type {
×
2
        Ajv2020 as Ajv,
×
3
        ValidateFunction,
×
4
} from 'ajv/dist/2020.js';
×
5

×
6
import {
×
7
        object_has_property,
×
8
} from '@satisfactory-dev/predicates.ts';
×
9

×
10
import type {
×
11
        $ref,
×
12
        SchemalessTypeOptions,
×
13
        SchemaObject,
×
14
        SchemaParser,
×
15
        TypeDefinitionSchema,
×
16
} from '@signpostmarv/json-schema-typescript-codegen';
×
17
import {
×
18
        Type,
×
19
} from '@signpostmarv/json-schema-typescript-codegen';
×
20

×
21
import {
×
22
        KeywordType,
×
23
} from '@signpostmarv/json-schema-typescript-codegen/ajv';
×
24

×
25
import type {
×
26
} from '@signpostmarv/json-schema-typescript-codegen/javascript-overrides';
×
27

×
28
import type {
×
29
        TypedString_DataTo__by_mode as TypedString_DataTo__by_mode__update6,
×
30
        TypedString_mode as TypedString_mode__update6,
×
31
        TypedString_schema_OneOf as TypedString_schema_OneOf__update6,
×
32
        TypedString_SchemaTo__by_mode as TypedString_SchemaTo__by_mode__update6,
×
33
        TypedString_type__by_mode as TypedString_type__by_mode__update6,
×
34
        TypedString_type_OneOf as TypedString_type_OneOf__update6,
×
35
} from '../0.6.1.5/TypedString.ts';
×
36
import {
×
37
        compile_validators,
×
38
        // eslint-disable-next-line @stylistic/max-len
×
39
        generate_typescript_data__by_mode as generate_typescript_data__by_mode__update6,
×
40
        // eslint-disable-next-line @stylistic/max-len
×
41
        generate_typescript_type__by_mode as generate_typescript_type__by_mode__update6,
×
42
        // eslint-disable-next-line @stylistic/max-len
×
43
        PropertySchemaToRegex__matchers_as_object as PropertySchemaToRegex__matchers_as_object__update6,
×
44
        TypedString as TypedString__update6,
×
45
} from '../0.6.1.5/TypedString.ts';
×
46

×
47
import type {
×
48
        Object_type,
×
49
        PropertySchemaToRegex,
×
50
} from '../0.3.7.7/TypedString/Object.ts';
×
51

×
52
import type {
×
53
        PropertySchemaToRegex__matchers_object,
×
54
} from '../0.3.7.7/TypedString.ts';
×
55

×
56
import {
×
57
        PrefixedString as PrefixedStringMatcher,
×
58
} from './TypedString/PropertySchemaToRegex/PrefixedString.ts';
×
59

×
60
import {
×
61
        NonEmptyString,
×
62
} from './TypedString/PropertySchemaToRegex/NonEmptyString.ts';
×
63

×
64
import {
×
65
        TemplatedStringMatcher,
×
66
} from './TypedString/PropertySchemaToRegex/TemplatedStringMatcher.ts';
×
67

×
68
type TypedString_mode = (
×
69
        | TypedString_mode__update6
×
70
);
×
71

×
72
export type TypedString_type__by_mode = (
×
73
        & TypedString_type__by_mode__update6
×
74
);
×
75

×
76
type TypedString_type<
×
77
        Mode extends TypedString_mode,
×
78
> = {
×
79
        type: 'string',
×
80
        typed_string: TypedString_type__by_mode[Mode],
×
81
};
×
82

×
83
type TypedString_matcher<
×
84
        Mode extends TypedString_mode,
×
85
> = [
×
86
        Mode,
×
87
        ValidateFunction<TypedString_type<Mode>['typed_string']>,
×
88
];
×
89

×
90
type TypedString_type_OneOf = {
×
91
        oneOf: [
×
92
                ...TypedString_type_OneOf__update6['oneOf'],
×
93
        ],
×
94
};
×
95

×
96
type TypedString_schema_OneOf = TypeDefinitionSchema & {
×
97
        oneOf: [
×
98
                ...TypedString_schema_OneOf__update6['oneOf'],
×
99
        ],
×
100
};
×
101

×
102
type TypedString_SchemaTo__by_mode = (
×
103
        & TypedString_SchemaTo__by_mode__update6
×
104
);
×
105

×
106
type TypedString_DataTo__by_mode = (
×
107
        & TypedString_DataTo__by_mode__update6
×
108
);
×
109

×
110
type TypedString_DataTo<
×
111
        Mode extends TypedString_mode,
×
112
> = TypedString_DataTo__by_mode[Mode];
×
113

×
114
type TypedString_SchemaTo<
×
115
        Mode extends TypedString_mode,
×
116
> = TypedString_SchemaTo__by_mode[Mode];
×
117

×
118
export function PropertySchemaToRegex__matchers_as_object(
×
119
): PropertySchemaToRegex__matchers_object {
×
120
        return {
×
121
                ...PropertySchemaToRegex__matchers_as_object__update6(),
×
122
                NonEmptyString: ({ajv}) => [NonEmptyString(ajv)],
×
123
                PrefixedStringMatcher: ({ajv}) => [
×
124
                        ...([
×
125
                                'quoted',
×
126
                                'single_quoted',
×
127
                                'non_quoted',
×
128
                                'version_specific_default',
×
129
                        ] as const).flatMap((mode) => [
×
130
                                PrefixedStringMatcher(ajv, mode, 'Engine', 'quoted'),
×
131
                                PrefixedStringMatcher(ajv, mode, 'TemplateSequence', 'quoted'),
×
132
                                PrefixedStringMatcher(ajv, mode, 'FactoryGame', 'quoted'),
×
133
                                PrefixedStringMatcher(ajv, mode, 'AkAudio', 'quoted'),
×
134
                                PrefixedStringMatcher(
×
135
                                        ajv,
×
136
                                        mode,
×
137
                                        'CoreUObject',
×
138
                                        'quoted',
×
139
                                ),
×
140
                        ]),
×
141
                ],
×
142
                TemplatedStringMatcher: ({ajv}) => [TemplatedStringMatcher(ajv)],
×
143
        } as PropertySchemaToRegex__matchers_object;
×
144
}
×
145

×
146
export function PropertySchemaToRegex__matchers(
×
147
        ajv: Ajv,
×
148
        existing: PropertySchemaToRegex<unknown>[],
×
149
        Object_matcher_instance: PropertySchemaToRegex<{
×
150
                type: 'string',
×
151
                typed_string: Object_type,
×
152
        }>,
×
153
        $ref_instance: $ref,
×
154
) {
×
155
        return Object.values(
×
156
                PropertySchemaToRegex__matchers_as_object(),
×
157
        ).flatMap((cb) => cb({
×
158
                ajv,
×
159
                existing,
×
160
                Object_matcher_instance,
×
161
                $ref_instance,
×
162
        }));
×
163
}
×
164

×
165
function generate_typescript_data<
×
166
        Mode extends TypedString_mode,
×
167
>(
×
168
        data: string,
×
169
        schema_parser: SchemaParser,
×
170
        schema: TypedString_type<Mode>,
×
171
        mode_by_validator: TypedString_matcher<TypedString_mode>[],
×
172
        property_schema_to_regex: PropertySchemaToRegex<unknown>[],
×
173
): TypedString_DataTo<Mode>|undefined {
×
174
        const mode = TypedString.mode_from_schema(
×
175
                schema.typed_string,
×
176
                mode_by_validator,
×
177
        );
×
178

×
179
        return generate_typescript_data__by_mode<Mode>(
×
180
                data,
×
181
                schema_parser,
×
182
                schema,
×
183
                mode,
×
184
                property_schema_to_regex,
×
185
        );
×
186
}
×
187

×
188
export function generate_typescript_data__by_mode<
×
189
        Mode extends TypedString_mode,
×
190
>(
×
191
        data: string,
×
192
        schema_parser: SchemaParser,
×
193
        schema: TypedString_type<Mode>,
×
194
        mode: Mode,
×
195
        property_schema_to_regex: PropertySchemaToRegex<unknown>[],
×
196
) {
×
197
        return generate_typescript_data__by_mode__update6(
×
198
                data,
×
199
                schema_parser,
×
200
                schema,
×
201
                mode,
×
202
                property_schema_to_regex,
×
203
        ) as TypedString_DataTo<Mode>|undefined;
×
204
}
×
205

×
206
function generate_typescript_type<
×
207
        Mode extends TypedString_mode,
×
208
>(
×
209
        data: unknown,
×
210
        schema: TypedString_type<Mode>,
×
211
        schema_parser: SchemaParser,
×
212
        mode_by_validator: TypedString_matcher<TypedString_mode>[],
×
213
): Promise<
×
214
        TypedString_SchemaTo<Mode>
×
215
>|undefined {
×
216
        const mode = TypedString.mode_from_schema(
×
217
                schema.typed_string,
×
218
                mode_by_validator,
×
219
        );
×
220

×
221
        return generate_typescript_type__by_mode(
×
222
                data,
×
223
                schema,
×
224
                schema_parser,
×
225
                mode,
×
226
        );
×
227
}
×
228

×
229
export function generate_typescript_type__by_mode<
×
230
        Mode extends TypedString_mode,
×
231
>(
×
232
        data: unknown,
×
233
        schema: TypedString_type<Mode>,
×
234
        schema_parser: SchemaParser,
×
235
        mode: Mode,
×
236
): Promise<
×
237
        TypedString_SchemaTo<Mode>
×
238
>|undefined {
×
239
        return generate_typescript_type__by_mode__update6(
×
240
                data,
×
241
                schema,
×
242
                schema_parser,
×
243
                mode,
×
244
        ) as Promise<TypedString_SchemaTo<Mode>>|undefined;
×
245
}
×
246

×
247
export class TypedString<
×
248
        Mode extends TypedString_mode,
×
249
> extends
×
250
        KeywordType<
×
251
                Exclude<string, ''>,
×
252
                TypedString_type_OneOf,
×
253
                Record<string, never>,
×
254
                TypedString_schema_OneOf,
×
255
                Record<string, never>,
×
256
                TypedString_SchemaTo<Mode>,
×
257
                TypedString_DataTo<Mode>,
×
258
                TypedString_type<Mode>
×
259
        > {
×
260
        #mode_by_validator: TypedString_matcher<TypedString_mode>[];
×
261

×
262
        #property_schema_to_regex: PropertySchemaToRegex<unknown>[];
×
263

×
264
        constructor(
×
265
                options: SchemalessTypeOptions,
×
266
                {
×
267
                        $ref_instance,
×
268
                        Object: Object_options,
×
269
                }: {
×
270
                        $ref_instance: $ref,
×
271
                        Object?: {
×
272
                                matchers: PropertySchemaToRegex<unknown>[],
×
273
                        },
×
274
                },
×
275
        ) {
×
276
                const mode_from_schema = compile_validators(options.ajv);
×
277

×
278
                const entries = Object.entries(mode_from_schema);
×
279

×
280
                super({
×
281
                        ...options,
×
282
                        ajv_keyword: {
×
283
                                keyword: 'typed_string',
×
284
                                type: 'string',
×
285
                                macro: (
×
286
                                        schema: TypedString_type<Mode>['typed_string'],
×
287
                                        parent_schema,
×
288
                                        it,
×
289
                                ) => {
×
290
                                        const mode = TypedString.mode_from_schema(
×
291
                                                schema,
×
292
                                                entries,
×
293
                                        );
×
294

×
295
                                        let root_schema: SchemaObject = {$defs: {}};
×
296

×
297
                                        if (
×
298
                                                object_has_property(it.self.schemas, it.baseId)
×
299
                                                && object_has_property(
×
300
                                                        it.self.schemas[it.baseId],
×
301
                                                        'schema',
×
302
                                                )
×
303
                                                && object_has_property(
×
304
                                                        it.self.schemas[it.baseId]?.schema,
×
305
                                                        '$defs',
×
306
                                                )
×
307
                                        ) {
×
308
                                                root_schema = it.self.schemas[
×
309
                                                        it.baseId
×
310
                                                ]?.schema as SchemaObject;
×
311
                                        } else if (
×
312
                                                '#' === it.baseId
×
313
                                                && object_has_property(
×
314
                                                        it.schemaEnv.root.schema,
×
315
                                                        '$defs',
×
316
                                                )
×
317
                                        ) {
×
318
                                                root_schema = (
×
319
                                                        it.schemaEnv.root.schema as SchemaObject
×
320
                                                );
×
321
                                        }
×
322

×
323
                                        if (Object.keys(root_schema.$defs || {}).length > 0) {
×
324
                                                schema = Type.maybe_add_$defs(
×
325
                                                        root_schema,
×
326
                                                        schema,
×
327
                                                );
×
328
                                        }
×
329

×
330
                                        return TypedString.ajv_macro(mode, schema, {
×
331
                                                $ref_instance,
×
332
                                                Object: Object_options || {
×
333
                                                        matchers: [],
×
334
                                                },
×
335
                                        });
×
336
                                },
×
337
                        },
×
338
                        type_definition: {},
×
339
                        schema_definition: {},
×
340
                });
×
341

×
342
                this.#mode_by_validator = entries;
×
343
                this.#property_schema_to_regex = Object_options?.matchers || [];
×
344
        }
×
345

×
346
        generate_typescript_data(
×
347
                data: string,
×
348
                schema_parser: SchemaParser,
×
349
                schema: TypedString_type<Mode>,
×
350
        ): TypedString_DataTo<Mode> {
×
351
                const result = generate_typescript_data(
×
352
                        data,
×
353
                        schema_parser,
×
354
                        schema,
×
355
                        this.#mode_by_validator,
×
356
                        this.#property_schema_to_regex,
×
357
                );
×
358

×
359
                if (!result) {
×
360
                        throw new TypeError('Not implemented!');
×
361
                }
×
362

×
363
                return result;
×
364
        }
×
365

×
366
        async generate_typescript_type({
×
367
                data,
×
368
                schema,
×
369
                schema_parser,
×
370
        }: {
×
371
                data: unknown,
×
372
                schema: TypedString_type<Mode>,
×
373
                schema_parser: SchemaParser,
×
374
        }): Promise<TypedString_SchemaTo<Mode>> {
×
375
                const result = generate_typescript_type(
×
376
                        data,
×
377
                        schema,
×
378
                        schema_parser,
×
379
                        this.#mode_by_validator,
×
380
                );
×
381

×
382
                if (undefined === result) {
×
383
                        throw new TypeError('not implemented!');
×
384
                }
×
385

×
386
                return result;
×
387
        }
×
388

×
389
        static ajv_macro<
×
390
                Mode extends TypedString_mode,
×
391
        >(
×
392
                mode: Mode,
×
393
                schema: TypedString_type<Mode>['typed_string'],
×
394
                options: {
×
395
                        $ref_instance: $ref,
×
396
                        Object: {
×
397
                                matchers: PropertySchemaToRegex<unknown>[],
×
398
                        },
×
399
                },
×
400
        ) {
×
401
                return TypedString__update6.ajv_macro(
×
402
                        mode,
×
403
                        schema,
×
404
                        options,
×
405
                );
×
406
        }
×
407

×
408
        static generate_schema_definition(): Readonly<TypedString_schema_OneOf> {
×
409
                return Object.freeze({
×
410
                        oneOf: [
×
411
                                ...TypedString__update6.generate_schema_definition().oneOf,
×
412
                        ],
×
413
                });
×
414
        }
×
415

×
416
        static generate_type_definition(): Readonly<TypedString_type_OneOf> {
×
417
                return Object.freeze({
×
418
                        oneOf: [
×
419
                                ...TypedString__update6.generate_type_definition().oneOf,
×
420
                        ],
×
421
                });
×
422
        }
×
423

×
424
        static mode_from_schema<
×
425
                Mode extends TypedString_mode,
×
426
        >(
×
427
                schema: TypedString_type<Mode>['typed_string'],
×
428
                matchers: TypedString_matcher<TypedString_mode>[],
×
429
        ): Mode;
×
430
        static mode_from_schema(
×
431
                schema: unknown,
×
432
                matchers: TypedString_matcher<TypedString_mode>[],
×
433
        ): TypedString_mode {
×
434
                let match = matchers.find(([, maybe]) => maybe(schema));
×
435

×
436
                if (undefined === match) {
×
437
                        if (
×
438
                                object_has_property(schema, 'uniqueItems')
×
439
                                && false === schema.uniqueItems
×
440
                        ) {
×
441
                                match = matchers.find(([, maybe]) => maybe({
×
442
                                        ...schema,
×
443
                                        uniqueItems: true,
×
444
                                }));
×
445
                        }
×
446
                }
×
447

×
UNCOV
448
                if (undefined === match) {
×
UNCOV
449
                        throw new TypeError('No mode determined for schema!');
×
UNCOV
450
                }
×
UNCOV
451

×
UNCOV
452
                return match[0];
×
UNCOV
453
        }
×
UNCOV
454
}
×
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