@satisfactory-dev/docs.json.ts 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/assert/CustomAssert.js +0 -1
  2. package/lib/AjvUtilities.js +0 -1
  3. package/lib/CustomParsingTypes/CustomPairingTypes.d.ts +0 -28
  4. package/lib/CustomParsingTypes/CustomPairingTypes.js +0 -37
  5. package/lib/CustomParsingTypes/TypedString.js +0 -1
  6. package/lib/CustomParsingTypes/TypedStringConst.js +2 -3
  7. package/lib/CustomParsingTypes/TypedStringEnum.js +2 -3
  8. package/lib/CustomParsingTypes/TypedStringPattern.js +2 -3
  9. package/lib/CustomParsingTypes/UnrealEngineString.js +2 -3
  10. package/lib/CustomParsingTypes/ValueToRegexFormatter.js +3 -3
  11. package/lib/DataDiscovery/CustomTypes/BooleanOrBooleanExtended.js +0 -1
  12. package/lib/DataDiscovery/CustomTypes/StringStartsWith.js +1 -2
  13. package/lib/DataDiscovery/CustomTypes/TypedString.js +2 -2
  14. package/lib/DataDiscovery/CustomTypes/UnrealEngineString.js +1 -3
  15. package/lib/DataDiscovery/Generator.js +0 -1
  16. package/lib/DataDiscovery/JsonSchema/Array.js +0 -1
  17. package/lib/DataDiscovery/JsonSchema/Object.js +1 -3
  18. package/lib/DataDiscovery/JsonSchema/OneOf.js +0 -1
  19. package/lib/DataDiscovery/JsonSchema/Ref.js +0 -1
  20. package/lib/DataDiscovery/JsonSchema/StringType.js +1 -3
  21. package/lib/DataDiscovery/Literal.js +1 -3
  22. package/lib/DataDiscovery.js +0 -1
  23. package/lib/DocsToAutoImport/ArrayTypeNodes.js +0 -1
  24. package/lib/DocsToAutoImport/ClassDeclarations.js +0 -1
  25. package/lib/DocsToAutoImport/FunctionDeclaration.js +0 -1
  26. package/lib/DocsToAutoImport/LiteralTypeNodes.js +0 -1
  27. package/lib/DocsToAutoImport/MethodDeclarations.js +0 -1
  28. package/lib/DocsToAutoImport/NodeExtraction.js +0 -1
  29. package/lib/DocsToAutoImport/PropertyDeclarations.js +0 -1
  30. package/lib/DocsToAutoImport/TupleTypeNodes.js +0 -1
  31. package/lib/DocsToAutoImport/TypeLiteralNodes.js +0 -1
  32. package/lib/DocsToAutoImport/TypeReferenceNodes.js +0 -1
  33. package/lib/DocsToAutoImport/from_Node_array.js +0 -1
  34. package/lib/DocsTsAutoImports.js +0 -1
  35. package/lib/DocsTsGenerator/FilesGenerator.js +0 -1
  36. package/lib/DocsTsGenerator.js +1 -3
  37. package/lib/DocsValidation.js +1 -2
  38. package/lib/Exceptions.js +0 -1
  39. package/lib/FilesGenerator.js +0 -1
  40. package/lib/MarkdownUtilities.js +0 -1
  41. package/lib/StringStartsWith.d.ts +0 -1
  42. package/lib/StringStartsWith.js +1 -4
  43. package/lib/TsFactoryWrapper.js +1 -3
  44. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/UnrealEngineString.js +0 -1
  45. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/string_starts_with.js +0 -1
  46. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/typed_string.js +1 -2
  47. package/lib/TypeDefinitionDiscovery/Generator.js +0 -1
  48. package/lib/TypeDefinitionDiscovery/GeneratorDoesDiscovery.js +0 -1
  49. package/lib/TypeDefinitionDiscovery/JsonSchema/ArrayType.js +1 -2
  50. package/lib/TypeDefinitionDiscovery/JsonSchema/Object/ExtendsObject.js +0 -1
  51. package/lib/TypeDefinitionDiscovery/JsonSchema/ObjectType.js +1 -2
  52. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Const.js +0 -1
  53. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum/BooleanEnum.js +0 -1
  54. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum.js +0 -1
  55. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Pattern.js +0 -1
  56. package/lib/TypeDefinitionDiscovery/JsonSchema/String.js +0 -1
  57. package/lib/TypeDefinitionDiscovery/JsonSchema/oneOf_or_anyOf.js +0 -1
  58. package/lib/TypeDefinitionDiscovery.js +1 -3
  59. package/lib/TypeDefinitionWriter.js +1 -3
  60. package/lib/TypesDiscovery/CandidatesDiscovery.js +0 -1
  61. package/lib/TypesDiscovery/CustomParsingTypes/UnrealEngineString.js +1 -2
  62. package/lib/TypesDiscovery/CustomParsingTypes/typed_string.js +2 -3
  63. package/lib/TypesDiscovery/JsonSchema/$ref.js +1 -3
  64. package/lib/TypesDiscovery/JsonSchema/const.js +2 -3
  65. package/lib/TypesDiscovery/JsonSchema/enum.js +2 -3
  66. package/lib/TypesDiscovery/JsonSchema/properties.js +1 -2
  67. package/lib/TypesDiscovery/non_array_object_property.js +1 -2
  68. package/lib/TypesDiscovery/non_empty_array_property.js +1 -2
  69. package/lib/TypesDiscovery.js +1 -2
  70. package/lib/TypesGeneration/validators.js +0 -1
  71. package/lib/TypesGeneration.js +0 -1
  72. package/lib/__dirname.js +0 -1
  73. package/lib/generator.d.ts +2 -0
  74. package/lib/generator.js +2 -0
  75. package/lib/helpers.js +0 -1
  76. package/lib/index.d.ts +0 -4
  77. package/lib/index.js +0 -5
  78. package/package.json +3 -1
  79. package/setup_PerformanceObserver.js +6 -42
  80. package/lib/ArrayUtilities.d.ts +0 -24
  81. package/lib/ArrayUtilities.js +0 -21
@@ -2,4 +2,3 @@ import assert from 'assert';
2
2
  export function value_matches_ExpressionResult(maybe, expression_result, message) {
3
3
  assert.deepStrictEqual(maybe, expression_result.expression, message);
4
4
  }
5
- //# sourceMappingURL=CustomAssert.js.map
@@ -56,4 +56,3 @@ export function esmify(code) {
56
56
  }
57
57
  return code;
58
58
  }
59
- //# sourceMappingURL=AjvUtilities.js.map
@@ -1,31 +1,3 @@
1
- export declare function object_has_property<Property extends string = string, Value = unknown>(maybe: unknown, property: Property, predicate?: undefined | ((maybe: unknown) => maybe is Value)): maybe is {
2
- [key: string]: unknown;
3
- } & {
4
- [key in Property]: Value;
5
- };
6
- export declare function object_has_only_properties_that_match_predicate<Value = unknown>(maybe: unknown, predicate: (object_value: unknown) => object_value is Value): maybe is {
7
- [key: string]: Value;
8
- };
9
- export declare function property_exists_on_object(object: {
10
- [key: string]: unknown;
11
- }, property: string): property is keyof object;
12
- export declare function object_has_non_empty_array_property<Property extends string = string, Value = unknown>(maybe: unknown, property: Property, predicate?: undefined | ((inner_maybe: unknown) => inner_maybe is Value)): maybe is ({
13
- [key: string]: unknown;
14
- } & {
15
- [key in Property]: [Value, ...Value[]];
16
- });
17
- export declare function object_has_property_that_equals(maybe: unknown, property: string, expects: unknown): maybe is {
18
- [key: string]: unknown;
19
- } & {
20
- [key in typeof property]: typeof expects;
21
- };
22
- export declare function value_is_non_array_object(maybe: unknown): maybe is {
23
- [key: string]: unknown;
24
- };
25
- export declare function is_non_empty_array<T = unknown>(maybe: unknown, predicate?: undefined | ((inner_maybe: unknown) => inner_maybe is T)): maybe is [T, ...T[]];
26
- export declare function object_only_has_that_property<T = unknown>(maybe: unknown, property: string, predicate?: undefined | ((maybe: unknown) => maybe is T)): maybe is {
27
- [key in typeof property]: T;
28
- };
29
1
  export declare function annoyingly_have_to_escape_property(property: string): string;
30
2
  export declare abstract class SupportedSubSchemaType<ObjectType extends {
31
3
  [key: string]: unknown;
@@ -1,42 +1,5 @@
1
- export function object_has_property(maybe, property, predicate = undefined) {
2
- return (value_is_non_array_object(maybe)
3
- && property in maybe
4
- && (undefined === predicate
5
- || predicate(maybe[property])));
6
- }
7
- export function object_has_only_properties_that_match_predicate(maybe, predicate) {
8
- return (value_is_non_array_object(maybe)
9
- && Object.values(maybe).every(e => predicate(e)));
10
- }
11
- export function property_exists_on_object(object, property) {
12
- return property in object;
13
- }
14
- export function object_has_non_empty_array_property(maybe, property, predicate = undefined) {
15
- return (object_has_property(maybe, property)
16
- && is_non_empty_array(maybe[property], predicate));
17
- }
18
- export function object_has_property_that_equals(maybe, property, expects) {
19
- return object_has_property(maybe, property) && expects === maybe[property];
20
- }
21
- export function value_is_non_array_object(maybe) {
22
- return ('object' === typeof maybe
23
- && !(maybe instanceof Array)
24
- && null !== maybe);
25
- }
26
- export function is_non_empty_array(maybe, predicate = undefined) {
27
- return (maybe instanceof Array
28
- && maybe.length >= 1
29
- && (undefined === predicate || maybe.every((e) => predicate(e))));
30
- }
31
- export function object_only_has_that_property(maybe, property, predicate = undefined) {
32
- return (value_is_non_array_object(maybe)
33
- && object_has_property(maybe, property)
34
- && 1 === Object.keys(maybe).length
35
- && (undefined === predicate || predicate(maybe[property])));
36
- }
37
1
  export function annoyingly_have_to_escape_property(property) {
38
2
  return property.replace(/([[\]])/g, '\\$1');
39
3
  }
40
4
  export class SupportedSubSchemaType {
41
5
  }
42
- //# sourceMappingURL=CustomPairingTypes.js.map
@@ -201,4 +201,3 @@ export class TypedString {
201
201
  return this._instance;
202
202
  }
203
203
  }
204
- //# sourceMappingURL=TypedString.js.map
@@ -1,6 +1,6 @@
1
+ import { is_string, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
1
2
  import { UnrealEngineString_general_regex, } from './UnrealEngineString';
2
- import { object_has_property, SupportedSubSchemaType, value_is_non_array_object, } from './CustomPairingTypes';
3
- import { is_string, } from '../StringStartsWith';
3
+ import { SupportedSubSchemaType, } from './CustomPairingTypes';
4
4
  export const typed_string_const_value_regex = `^(?:[A-Za-z0-9][A-Za-z0-9_ -]*|${UnrealEngineString_general_regex}|\\(\\))$`;
5
5
  export const typed_string_const_value_regex__native = new RegExp(typed_string_const_value_regex);
6
6
  export const typed_string_const_schema = {
@@ -32,4 +32,3 @@ class TypedStringConst extends SupportedSubSchemaType {
32
32
  }
33
33
  }
34
34
  export const typed_string_const = new TypedStringConst();
35
- //# sourceMappingURL=TypedStringConst.js.map
@@ -1,6 +1,6 @@
1
- import { object_has_non_empty_array_property, object_has_property, SupportedSubSchemaType, value_is_non_array_object, } from './CustomPairingTypes';
1
+ import { is_string, object_has_non_empty_array_property, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
2
+ import { SupportedSubSchemaType, } from './CustomPairingTypes';
2
3
  import { typed_string_const_value_regex, typed_string_const_value_regex__native, } from './TypedStringConst';
3
- import { is_string, } from '../StringStartsWith';
4
4
  export const typed_string_enum_schema = {
5
5
  type: 'object',
6
6
  required: ['type', 'enum'],
@@ -33,4 +33,3 @@ class TypedStringEnum extends SupportedSubSchemaType {
33
33
  }
34
34
  }
35
35
  export const typed_string_enum = new TypedStringEnum();
36
- //# sourceMappingURL=TypedStringEnum.js.map
@@ -1,5 +1,5 @@
1
- import { object_has_property, object_has_property_that_equals, SupportedSubSchemaType, value_is_non_array_object, } from './CustomPairingTypes';
2
- import { is_string, } from '../StringStartsWith';
1
+ import { is_string, object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
2
+ import { SupportedSubSchemaType, } from './CustomPairingTypes';
3
3
  export const typed_string_pattern_schema = {
4
4
  type: 'object',
5
5
  required: ['type', 'pattern'],
@@ -79,4 +79,3 @@ class TypedStringPatternGeneral extends SupportedSubSchemaType {
79
79
  }
80
80
  }
81
81
  export const typed_string_pattern_general = new TypedStringPatternGeneral();
82
- //# sourceMappingURL=TypedStringPattern.js.map
@@ -1,7 +1,7 @@
1
1
  import ts from 'typescript';
2
+ import { is_string, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
2
3
  import { adjust_class_name, create_const_statement, create_index_access, create_literal, create_method_with_type_parameters, create_method_without_type_parameters, create_modifiers, create_property_access, create_this_assignment, create_throw_if, create_type, createClass, createParameter, not, parenthesize, possibly_create_lazy_union, template_expression_from_string, type_reference_node, variable, } from '../TsFactoryWrapper';
3
- import { object_has_property, value_is_non_array_object, } from './CustomPairingTypes';
4
- import { is_string, local_ref, } from '../StringStartsWith';
4
+ import { local_ref, } from '../StringStartsWith';
5
5
  export const UnrealEngineString_regex = /^([^']+)'(?:"([^"]+)"|([^"]+))'$/;
6
6
  export const UnrealEngineString_general_regex = `/(?:[A-Z-][A-Za-z0-9_-]+/)+(?:[A-Z][A-Za-z_0-9-]+\\.[A-Z][A-Za-z_0-9-]+(?:_C)?(?::[A-Z][A-Za-z0-9_]+)?|[A-Z][A-Za-z_]+\\.[A-Z][A-Za-z_]+)`;
7
7
  export function string_or_string_array_to_node(value) {
@@ -305,4 +305,3 @@ function is_UnrealEngineString_object(maybe) {
305
305
  return ((2 === keys.length && has_left && has_right)
306
306
  || (1 === keys.length && (has_left || has_right)));
307
307
  }
308
- //# sourceMappingURL=UnrealEngineString.js.map
@@ -1,5 +1,6 @@
1
- import { annoyingly_have_to_escape_property, is_non_empty_array, object_has_non_empty_array_property, object_has_property, object_has_property_that_equals, object_only_has_that_property, value_is_non_array_object, } from './CustomPairingTypes';
2
- import { is_string, local_ref, } from '../StringStartsWith';
1
+ import { is_non_empty_array, is_string, object_has_non_empty_array_property, object_has_property, object_has_property_that_equals, object_only_has_that_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
2
+ import { annoyingly_have_to_escape_property, } from './CustomPairingTypes';
3
+ import { local_ref, } from '../StringStartsWith';
3
4
  import { NoMatchError, } from '../Exceptions';
4
5
  import { is_UnrealEngineString_parent, UnrealEngineString, } from './UnrealEngineString';
5
6
  import { typed_string_const, } from './TypedStringConst';
@@ -202,4 +203,3 @@ export class ValueToRegexFormatter {
202
203
  && 2 === Object.keys(maybe).length);
203
204
  }
204
205
  }
205
- //# sourceMappingURL=ValueToRegexFormatter.js.map
@@ -29,4 +29,3 @@ export class BooleanConverter extends ConverterMatchesSchema {
29
29
  : ts.factory.createFalse())));
30
30
  }
31
31
  }
32
- //# sourceMappingURL=BooleanOrBooleanExtended.js.map
@@ -1,6 +1,6 @@
1
1
  import { ConverterMatchesSchema, ExpressionResult, } from '../Generator';
2
2
  import { schema, } from '../../TypeDefinitionDiscovery/CustomParsingTypes/string_starts_with';
3
- import { is_string, } from '../../StringStartsWith';
3
+ import { is_string, } from '@satisfactory-dev/predicates.ts';
4
4
  import ts from 'typescript';
5
5
  import { create_literal, type_reference_node, } from '../../TsFactoryWrapper';
6
6
  export class StringStartsWithConverter extends ConverterMatchesSchema {
@@ -16,4 +16,3 @@ export class StringStartsWithConverter extends ConverterMatchesSchema {
16
16
  return Promise.resolve(new ExpressionResult(ts.factory.createAsExpression(ts.factory.createStringLiteral(raw_data), type_reference_node('StringStartsWith', create_literal(schema.string_starts_with)))));
17
17
  }
18
18
  }
19
- //# sourceMappingURL=StringStartsWith.js.map
@@ -1,6 +1,7 @@
1
+ import { is_string, } from '@satisfactory-dev/predicates.ts';
1
2
  import { Converter, ConverterMatchesSchema, ExpressionResult, } from '../Generator';
2
3
  import { generate_object_parent_schema, generate_typed_string_$defs, } from '../../CustomParsingTypes/TypedString';
3
- import { is_string, local_ref, } from '../../StringStartsWith';
4
+ import { local_ref, } from '../../StringStartsWith';
4
5
  import { NoMatchError, } from '../../Exceptions';
5
6
  import { string_to_array, string_to_object, } from '../../DocsValidation';
6
7
  import { compile, } from '../../AjvUtilities';
@@ -248,4 +249,3 @@ export class TypedStringConverter extends ConverterMatchesSchema {
248
249
  return result;
249
250
  }
250
251
  }
251
- //# sourceMappingURL=TypedString.js.map
@@ -1,9 +1,8 @@
1
+ import { is_string, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
1
2
  import { Converter, ExpressionResult, } from '../Generator';
2
- import { is_string, } from '../../StringStartsWith';
3
3
  import { is_UnrealEngineString_parent, string_or_string_array_to_node, UnrealEngineString_regex, } from '../../CustomParsingTypes/UnrealEngineString';
4
4
  import ts from 'typescript';
5
5
  import { create_literal, create_property_access, create_type, type_reference_node, } from '../../TsFactoryWrapper';
6
- import { object_has_property, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
7
6
  import { NoMatchError, } from '../../Exceptions';
8
7
  export class UnrealEngineStringConverter extends Converter {
9
8
  can_convert_schema(schema) {
@@ -42,4 +41,3 @@ export class UnrealEngineStringConverter extends Converter {
42
41
  return new ExpressionResult(ts.factory.createCallExpression(create_property_access(ts.factory.createIdentifier('UnrealEngineString'), 'fromString'), type_args, [ts.factory.createStringLiteral(raw_data)]));
43
42
  }
44
43
  }
45
- //# sourceMappingURL=UnrealEngineString.js.map
@@ -38,4 +38,3 @@ export class ExpressionResult {
38
38
  this.expression = expression;
39
39
  }
40
40
  }
41
- //# sourceMappingURL=Generator.js.map
@@ -38,4 +38,3 @@ export class ArrayConverter extends ConverterMatchesSchema {
38
38
  return new ExpressionResult(await this.discovery.literal.array_literal(converted));
39
39
  }
40
40
  }
41
- //# sourceMappingURL=Array.js.map
@@ -1,6 +1,5 @@
1
1
  import { Converter, ConverterMatchesSchema, ExpressionResult, } from '../Generator';
2
- import { object_has_property, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
3
- import { is_string, } from '../../StringStartsWith';
2
+ import { is_string, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
4
3
  import { NoMatchError, } from '../../Exceptions';
5
4
  import { pattern_properties_regex, } from '../../CustomParsingTypes/TypedString';
6
5
  class ObjectConverterMatchesSchema extends ConverterMatchesSchema {
@@ -181,4 +180,3 @@ export class PatternedObjectConverter extends ObjectConverterMatchesSchema {
181
180
  }, 'Method not implemented.');
182
181
  }
183
182
  }
184
- //# sourceMappingURL=Object.js.map
@@ -44,4 +44,3 @@ export class OneOfConverter extends ConverterMatchesSchema {
44
44
  }, 'Unable to convert data!');
45
45
  }
46
46
  }
47
- //# sourceMappingURL=OneOf.js.map
@@ -63,4 +63,3 @@ export class Ref extends ConverterMatchesSchema {
63
63
  return this.cache[schema.$ref];
64
64
  }
65
65
  }
66
- //# sourceMappingURL=Ref.js.map
@@ -1,9 +1,8 @@
1
1
  import { ConverterMatchesSchema, ExpressionResult, } from '../Generator';
2
+ import { is_string, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
2
3
  import { NoMatchError, } from '../../Exceptions';
3
- import { is_string, } from '../../StringStartsWith';
4
4
  import ts from 'typescript';
5
5
  import { create_literal, type_reference_node, } from '../../TsFactoryWrapper';
6
- import { object_has_property, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
7
6
  import { not_matching_string_schema, } from '../../TypeDefinitionDiscovery/JsonSchema/String';
8
7
  import { compile, } from '../../AjvUtilities';
9
8
  class StringConverter extends ConverterMatchesSchema {
@@ -118,4 +117,3 @@ export class PatternConverter extends ConverterMatchesSchema {
118
117
  return Promise.resolve(new ExpressionResult(ts.factory.createAsExpression(ts.factory.createStringLiteral(raw_data), type_reference_node('StringPassedRegExp', create_literal(schema.pattern)))));
119
118
  }
120
119
  }
121
- //# sourceMappingURL=StringType.js.map
@@ -1,8 +1,7 @@
1
1
  import { property_name_or_computed, } from '../TsFactoryWrapper';
2
2
  import { NoMatchError, } from '../Exceptions';
3
3
  import { ExpressionResult, } from './Generator';
4
- import { is_string, } from '../StringStartsWith';
5
- import { value_is_non_array_object, } from '../CustomParsingTypes/CustomPairingTypes';
4
+ import { is_string, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
6
5
  import ts from 'typescript';
7
6
  export class Literal {
8
7
  async array_literal(from) {
@@ -66,4 +65,3 @@ export class Literal {
66
65
  return result;
67
66
  }
68
67
  }
69
- //# sourceMappingURL=Literal.js.map
@@ -113,4 +113,3 @@ export class DataDiscovery extends FilesGenerator {
113
113
  `);
114
114
  }
115
115
  }
116
- //# sourceMappingURL=DataDiscovery.js.map
@@ -4,4 +4,3 @@ export class ArrayTypeNodes extends NodeExtraction {
4
4
  return nodes.map((e) => e.elementType);
5
5
  }
6
6
  }
7
- //# sourceMappingURL=ArrayTypeNodes.js.map
@@ -11,4 +11,3 @@ export class ClassDeclarations extends NodeExtraction {
11
11
  .flat(2);
12
12
  }
13
13
  }
14
- //# sourceMappingURL=ClassDeclarations.js.map
@@ -13,4 +13,3 @@ export class FunctionDeclarations extends NodeExtraction {
13
13
  .filter((maybe) => !!maybe);
14
14
  }
15
15
  }
16
- //# sourceMappingURL=FunctionDeclaration.js.map
@@ -20,4 +20,3 @@ export class LiteralTypeNodes extends NodeExtraction {
20
20
  return [];
21
21
  }
22
22
  }
23
- //# sourceMappingURL=LiteralTypeNodes.js.map
@@ -12,4 +12,3 @@ export class MethodDeclarations extends NodeExtraction {
12
12
  .filter((maybe) => !!maybe);
13
13
  }
14
14
  }
15
- //# sourceMappingURL=MethodDeclarations.js.map
@@ -18,4 +18,3 @@ export class NodeExtraction {
18
18
  this.results.push(...EntityName_array_from_Node_array(sub_nodes));
19
19
  }
20
20
  }
21
- //# sourceMappingURL=NodeExtraction.js.map
@@ -7,4 +7,3 @@ export class PropertyDeclarations extends NodeExtraction {
7
7
  .filter((maybe) => !!maybe);
8
8
  }
9
9
  }
10
- //# sourceMappingURL=PropertyDeclarations.js.map
@@ -4,4 +4,3 @@ export class TupleTypeNodes extends NodeExtraction {
4
4
  return nodes.map((e) => e.elements).flat();
5
5
  }
6
6
  }
7
- //# sourceMappingURL=TupleTypeNodes.js.map
@@ -30,4 +30,3 @@ export class TypeLiteralNodes extends NodeExtraction {
30
30
  return types;
31
31
  }
32
32
  }
33
- //# sourceMappingURL=TypeLiteralNodes.js.map
@@ -4,4 +4,3 @@ export class TypeReferenceNodes extends NodeExtraction {
4
4
  return nodes.map((e) => e.typeName);
5
5
  }
6
6
  }
7
- //# sourceMappingURL=TypeReferenceNodes.js.map
@@ -242,4 +242,3 @@ export function from_Node_array(nodes) {
242
242
  }),
243
243
  ];
244
244
  }
245
- //# sourceMappingURL=from_Node_array.js.map
@@ -107,4 +107,3 @@ export class DocsTsAutoImports {
107
107
  return from.escapedText.toString();
108
108
  }
109
109
  }
110
- //# sourceMappingURL=DocsTsAutoImports.js.map
@@ -49,4 +49,3 @@ export class FilesGenerator extends Base {
49
49
  };
50
50
  }
51
51
  }
52
- //# sourceMappingURL=FilesGenerator.js.map
@@ -9,8 +9,7 @@ import update8_schema from '../schema/update8.schema.json' with {
9
9
  type: 'json'
10
10
  };
11
11
  import { createHash, } from 'node:crypto';
12
- import { is_non_empty_array, object_has_only_properties_that_match_predicate, object_has_property, property_exists_on_object, value_is_non_array_object, } from './CustomParsingTypes/CustomPairingTypes';
13
- import { is_string, } from './StringStartsWith';
12
+ import { is_non_empty_array, is_string, object_has_only_properties_that_match_predicate, object_has_property, property_exists_on_object, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
14
13
  import { NoMatchError, } from './Exceptions';
15
14
  import { TypedString, } from './CustomParsingTypes/TypedString';
16
15
  import { compile, esmify, } from './AjvUtilities';
@@ -185,4 +184,3 @@ export async function eslint_generated_types(parent_folder) {
185
184
  const results = await eslint.lintFiles(`${parent_folder}/**/*.ts`);
186
185
  process.stdout.write(`${await (await eslint_formatter).format(results)}\n`);
187
186
  }
188
- //# sourceMappingURL=DocsTsGenerator.js.map
@@ -1,6 +1,6 @@
1
1
  import { _, } from 'ajv/dist/2020';
2
2
  import { UnrealEngineString, } from './CustomParsingTypes/UnrealEngineString';
3
- import { is_string, } from './StringStartsWith';
3
+ import { is_string, } from '@satisfactory-dev/predicates.ts';
4
4
  export function string_to_native_type(data, shallow = false) {
5
5
  data = data.trim();
6
6
  if (/^\(.+\)$/.test(data)) {
@@ -176,4 +176,3 @@ export function configure_ajv(ajv) {
176
176
  },
177
177
  });
178
178
  }
179
- //# sourceMappingURL=DocsValidation.js.map
package/lib/Exceptions.js CHANGED
@@ -10,4 +10,3 @@ export class FragileTypeSafetyError extends NoMatchError {
10
10
  super(property, 'type safety in here is a bit fragile, check earlier in the stack');
11
11
  }
12
12
  }
13
- //# sourceMappingURL=Exceptions.js.map
@@ -35,4 +35,3 @@ export function guess_filename(ref) {
35
35
  }
36
36
  return 'common/unassigned.ts';
37
37
  }
38
- //# sourceMappingURL=FilesGenerator.js.map
@@ -65,4 +65,3 @@ export function remove_indentation(input) {
65
65
  }
66
66
  return str;
67
67
  }
68
- //# sourceMappingURL=MarkdownUtilities.js.map
@@ -5,6 +5,5 @@ export type StringStartsWith<Prefix extends string, Suffix extends string = stri
5
5
  };
6
6
  export type local_ref<T extends string> = StringStartsWith<'#/$defs/', T>;
7
7
  export declare function local_ref<T extends string = string>(ref_like_string: T): local_ref<T>;
8
- export declare function is_string(maybe: unknown): maybe is string;
9
8
  export declare function is_$ref(maybe: unknown): maybe is (typeof maybe extends string ? local_ref<typeof maybe> : never);
10
9
  export declare function $ref_in_array(maybe_$ref: unknown, $ref_array: local_ref<string>[]): maybe_$ref is never;
@@ -1,3 +1,4 @@
1
+ import { is_string, } from '@satisfactory-dev/predicates.ts';
1
2
  import { NoMatchError, } from './Exceptions';
2
3
  export function local_ref(ref_like_string) {
3
4
  if (/\s+/.test(ref_like_string)) {
@@ -8,13 +9,9 @@ export function local_ref(ref_like_string) {
8
9
  }
9
10
  return `#/$defs/${ref_like_string}`;
10
11
  }
11
- export function is_string(maybe) {
12
- return 'string' === typeof maybe;
13
- }
14
12
  export function is_$ref(maybe) {
15
13
  return is_string(maybe) && maybe.startsWith('#/$defs/');
16
14
  }
17
15
  export function $ref_in_array(maybe_$ref, $ref_array) {
18
16
  return is_$ref(maybe_$ref) && $ref_array.includes(maybe_$ref);
19
17
  }
20
- //# sourceMappingURL=StringStartsWith.js.map
@@ -1,6 +1,5 @@
1
1
  import ts from 'typescript';
2
- import { is_string, } from './StringStartsWith';
3
- import { non_empty_map, } from './ArrayUtilities';
2
+ import { is_string, non_empty_map, } from '@satisfactory-dev/predicates.ts';
4
3
  export function adjust_class_name(class_name) {
5
4
  if ('boolean' === class_name) {
6
5
  return 'Docs_boolean';
@@ -233,4 +232,3 @@ export function variable(name, value, type = undefined) {
233
232
  export function not(expression) {
234
233
  return ts.factory.createLogicalNot(expression);
235
234
  }
236
- //# sourceMappingURL=TsFactoryWrapper.js.map
@@ -23,4 +23,3 @@ export class UnrealEngineString extends Generator {
23
23
  };
24
24
  }
25
25
  }
26
- //# sourceMappingURL=UnrealEngineString.js.map
@@ -17,4 +17,3 @@ export class string_starts_with extends Generator {
17
17
  return (raw_data) => type_reference_node('StringStartsWith', create_literal(raw_data.string_starts_with));
18
18
  }
19
19
  }
20
- //# sourceMappingURL=string_starts_with.js.map
@@ -3,7 +3,7 @@ import { create_object_type_from_entries, createPropertySignature, minimum_size_
3
3
  import { GeneratorDoesDiscovery, } from '../GeneratorDoesDiscovery';
4
4
  import { UnrealEngineString, } from './UnrealEngineString';
5
5
  import { generate_object_parent_schema, generate_typed_string_$defs, } from '../../CustomParsingTypes/TypedString';
6
- import { object_has_property, } from '../../CustomParsingTypes/CustomPairingTypes';
6
+ import { object_has_property, } from '@satisfactory-dev/predicates.ts';
7
7
  function create_combinations(values) {
8
8
  const as_array = [...values.values()];
9
9
  const entered = [JSON.stringify(as_array)];
@@ -93,4 +93,3 @@ export class typed_string extends GeneratorDoesDiscovery {
93
93
  return object_has_property(maybe, 'prefixItems');
94
94
  }
95
95
  }
96
- //# sourceMappingURL=typed_string.js.map
@@ -5,4 +5,3 @@ export class Generator {
5
5
  this.check = compile(ajv, schema);
6
6
  }
7
7
  }
8
- //# sourceMappingURL=Generator.js.map
@@ -6,4 +6,3 @@ export class GeneratorDoesDiscovery extends Generator {
6
6
  this.discovery = discovery;
7
7
  }
8
8
  }
9
- //# sourceMappingURL=GeneratorDoesDiscovery.js.map
@@ -1,6 +1,6 @@
1
1
  import { GeneratorDoesDiscovery, } from '../GeneratorDoesDiscovery';
2
2
  import ts from 'typescript';
3
- import { object_has_non_empty_array_property, object_has_property, } from '../../CustomParsingTypes/CustomPairingTypes';
3
+ import { object_has_non_empty_array_property, object_has_property, } from '@satisfactory-dev/predicates.ts';
4
4
  import { minimum_size_array_of_single_type, } from '../../TsFactoryWrapper';
5
5
  import { NoMatchError, } from '../../Exceptions';
6
6
  export class ArrayType extends GeneratorDoesDiscovery {
@@ -58,4 +58,3 @@ export class ArrayType extends GeneratorDoesDiscovery {
58
58
  };
59
59
  }
60
60
  }
61
- //# sourceMappingURL=ArrayType.js.map
@@ -37,4 +37,3 @@ export class ExtendsObject extends GeneratorDoesDiscovery {
37
37
  return ts.factory.createTypeReferenceNode(adjust_class_name(`${$ref.substring(8)}__type`));
38
38
  }
39
39
  }
40
- //# sourceMappingURL=ExtendsObject.js.map
@@ -1,7 +1,7 @@
1
1
  import ts from 'typescript';
2
2
  import { adjust_class_name, create_object_type_from_entries, type_reference_node, } from '../../TsFactoryWrapper';
3
3
  import { GeneratorDoesDiscovery, } from '../GeneratorDoesDiscovery';
4
- import { is_string, } from '../../StringStartsWith';
4
+ import { is_string, } from '@satisfactory-dev/predicates.ts';
5
5
  export const schema = {
6
6
  type: 'object',
7
7
  required: ['type', 'properties'],
@@ -73,4 +73,3 @@ export class ObjectType extends GeneratorDoesDiscovery {
73
73
  };
74
74
  }
75
75
  }
76
- //# sourceMappingURL=ObjectType.js.map
@@ -17,4 +17,3 @@ export class Const extends Generator {
17
17
  return (raw_data) => create_literal(raw_data.const);
18
18
  }
19
19
  }
20
- //# sourceMappingURL=Const.js.map
@@ -44,4 +44,3 @@ export class BooleanEnum extends Generator {
44
44
  };
45
45
  }
46
46
  }
47
- //# sourceMappingURL=BooleanEnum.js.map
@@ -19,4 +19,3 @@ export class Enum extends Generator {
19
19
  };
20
20
  }
21
21
  }
22
- //# sourceMappingURL=Enum.js.map
@@ -18,4 +18,3 @@ export class Pattern extends Generator {
18
18
  };
19
19
  }
20
20
  }
21
- //# sourceMappingURL=Pattern.js.map
@@ -69,4 +69,3 @@ export class NonEmptyStringWithExclusions extends Generator {
69
69
  ]));
70
70
  }
71
71
  }
72
- //# sourceMappingURL=String.js.map
@@ -44,4 +44,3 @@ export class oneOf_or_anyOf extends GeneratorDoesDiscovery {
44
44
  };
45
45
  }
46
46
  }
47
- //# sourceMappingURL=oneOf_or_anyOf.js.map
@@ -1,6 +1,5 @@
1
1
  import { TypesDiscovery, } from './TypesDiscovery';
2
- import { is_non_empty_array, object_has_non_empty_array_property, object_has_property, value_is_non_array_object, } from './CustomParsingTypes/CustomPairingTypes';
3
- import { is_string, } from './StringStartsWith';
2
+ import { is_non_empty_array, is_string, object_has_non_empty_array_property, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
4
3
  import ts from 'typescript';
5
4
  import { Const, } from './TypeDefinitionDiscovery/JsonSchema/String/Const';
6
5
  import { Pattern, } from './TypeDefinitionDiscovery/JsonSchema/String/Pattern';
@@ -373,4 +372,3 @@ export class TypeDefinitionDiscovery extends FilesGenerator {
373
372
  ];
374
373
  }
375
374
  }
376
- //# sourceMappingURL=TypeDefinitionDiscovery.js.map
@@ -7,7 +7,7 @@ import { ExtendsObject, } from './TypeDefinitionDiscovery/JsonSchema/Object/Exte
7
7
  import { typed_string, } from './TypeDefinitionDiscovery/CustomParsingTypes/typed_string';
8
8
  import { oneOf_or_anyOf, } from './TypeDefinitionDiscovery/JsonSchema/oneOf_or_anyOf';
9
9
  import { glob, } from 'glob';
10
- import { object_has_property, value_is_non_array_object, } from './CustomParsingTypes/CustomPairingTypes';
10
+ import { object_has_property, require_non_empty_array, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
11
11
  import ts from 'typescript';
12
12
  import { DocsTsAutoImports, } from './DocsTsAutoImports';
13
13
  import { dirname, } from 'node:path';
@@ -17,7 +17,6 @@ import { string_starts_with, StringPassedRegExp, } from './TypesGeneration/valid
17
17
  import { NoMatchError, } from './Exceptions';
18
18
  import { FilesGenerator, FromArray, } from './FilesGenerator';
19
19
  import { FilesGenerator as DocsFiles, } from './DocsTsGenerator/FilesGenerator';
20
- import { require_non_empty_array, } from './ArrayUtilities';
21
20
  import { DataDiscovery, } from './DataDiscovery';
22
21
  import { __dirname_from_meta, } from './__dirname';
23
22
  import { compile, } from './AjvUtilities';
@@ -230,4 +229,3 @@ export class TypeDefinitionWriter {
230
229
  && ts.isIdentifier(heritage[0][0].expression));
231
230
  }
232
231
  }
233
- //# sourceMappingURL=TypeDefinitionWriter.js.map
@@ -11,4 +11,3 @@ export class PropertyDependentDiscovery extends CandidatesDiscovery {
11
11
  this.property = property;
12
12
  }
13
13
  }
14
- //# sourceMappingURL=CandidatesDiscovery.js.map
@@ -1,5 +1,5 @@
1
1
  import { CandidatesDiscovery, } from '../CandidatesDiscovery';
2
- import { object_has_property, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
2
+ import { object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
3
  import { local_ref, } from '../../StringStartsWith';
4
4
  import { is_UnrealEngineString_parent, } from '../../CustomParsingTypes/UnrealEngineString';
5
5
  export class UnrealEngineString extends CandidatesDiscovery {
@@ -15,4 +15,3 @@ export class UnrealEngineString extends CandidatesDiscovery {
15
15
  return undefined;
16
16
  }
17
17
  }
18
- //# sourceMappingURL=UnrealEngineString.js.map
@@ -1,6 +1,6 @@
1
1
  import { CandidatesDiscovery, } from '../CandidatesDiscovery';
2
- import { object_has_non_empty_array_property, object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
3
- import { is_string, local_ref, } from '../../StringStartsWith';
2
+ import { is_string, object_has_non_empty_array_property, object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
+ import { local_ref, } from '../../StringStartsWith';
4
4
  export class typed_string extends CandidatesDiscovery {
5
5
  discovery_candidates(current, discovered_types) {
6
6
  if (object_has_property(current, '$defs', value_is_non_array_object)) {
@@ -31,4 +31,3 @@ export class typed_string extends CandidatesDiscovery {
31
31
  && object_has_non_empty_array_property(maybe.typed_string, 'prefixItems', value_is_non_array_object))));
32
32
  }
33
33
  }
34
- //# sourceMappingURL=typed_string.js.map
@@ -1,6 +1,5 @@
1
1
  import { CandidatesDiscovery, } from '../CandidatesDiscovery';
2
- import { object_has_property, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
3
- import { is_string, } from '../../StringStartsWith';
2
+ import { is_string, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
4
3
  export class $ref extends CandidatesDiscovery {
5
4
  $defs;
6
5
  constructor(schema) {
@@ -30,4 +29,3 @@ export class $ref extends CandidatesDiscovery {
30
29
  return undefined;
31
30
  }
32
31
  }
33
- //# sourceMappingURL=$ref.js.map
@@ -1,6 +1,6 @@
1
1
  import { CandidatesDiscovery, } from '../CandidatesDiscovery';
2
- import { object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
3
- import { is_string, local_ref, } from '../../StringStartsWith';
2
+ import { is_string, object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
+ import { local_ref, } from '../../StringStartsWith';
4
4
  export class ConstString extends CandidatesDiscovery {
5
5
  discovery_candidates(current, discovered_types) {
6
6
  if (object_has_property(current, '$defs', value_is_non_array_object)) {
@@ -19,4 +19,3 @@ export class ConstString extends CandidatesDiscovery {
19
19
  && 2 === Object.keys(maybe).length);
20
20
  }
21
21
  }
22
- //# sourceMappingURL=const.js.map
@@ -1,6 +1,6 @@
1
1
  import { CandidatesDiscovery, } from '../CandidatesDiscovery';
2
- import { object_has_non_empty_array_property, object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
3
- import { is_string, local_ref, } from '../../StringStartsWith';
2
+ import { is_string, object_has_non_empty_array_property, object_has_property, object_has_property_that_equals, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
+ import { local_ref, } from '../../StringStartsWith';
4
4
  export class EnumString extends CandidatesDiscovery {
5
5
  discovery_candidates(current, discovered_types) {
6
6
  if (object_has_property(current, '$defs', value_is_non_array_object)) {
@@ -19,4 +19,3 @@ export class EnumString extends CandidatesDiscovery {
19
19
  && 2 === Object.keys(maybe).length);
20
20
  }
21
21
  }
22
- //# sourceMappingURL=enum.js.map
@@ -1,5 +1,5 @@
1
1
  import { CandidatesDiscovery, } from '../CandidatesDiscovery';
2
- import { is_non_empty_array, object_has_property, value_is_non_array_object, } from '../../CustomParsingTypes/CustomPairingTypes';
2
+ import { is_non_empty_array, object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
3
  export class properties extends CandidatesDiscovery {
4
4
  discovery_candidates(current) {
5
5
  if (object_has_property(current, 'properties', value_is_non_array_object)) {
@@ -11,4 +11,3 @@ export class properties extends CandidatesDiscovery {
11
11
  return undefined;
12
12
  }
13
13
  }
14
- //# sourceMappingURL=properties.js.map
@@ -1,5 +1,5 @@
1
1
  import { PropertyDependentDiscovery, } from './CandidatesDiscovery';
2
- import { object_has_property, value_is_non_array_object, } from '../CustomParsingTypes/CustomPairingTypes';
2
+ import { object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
3
  export class non_array_object_property extends PropertyDependentDiscovery {
4
4
  discovery_candidates(current) {
5
5
  if (object_has_property(current, this.property, value_is_non_array_object)) {
@@ -8,4 +8,3 @@ export class non_array_object_property extends PropertyDependentDiscovery {
8
8
  return undefined;
9
9
  }
10
10
  }
11
- //# sourceMappingURL=non_array_object_property.js.map
@@ -1,5 +1,5 @@
1
1
  import { PropertyDependentDiscovery, } from './CandidatesDiscovery';
2
- import { object_has_non_empty_array_property, value_is_non_array_object, } from '../CustomParsingTypes/CustomPairingTypes';
2
+ import { object_has_non_empty_array_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
3
3
  export class non_empty_array_property extends PropertyDependentDiscovery {
4
4
  discovery_candidates(current) {
5
5
  if (object_has_non_empty_array_property(current, this.property, value_is_non_array_object)) {
@@ -8,4 +8,3 @@ export class non_empty_array_property extends PropertyDependentDiscovery {
8
8
  return undefined;
9
9
  }
10
10
  }
11
- //# sourceMappingURL=non_empty_array_property.js.map
@@ -1,4 +1,4 @@
1
- import { object_has_property, value_is_non_array_object, } from './CustomParsingTypes/CustomPairingTypes';
1
+ import { object_has_property, value_is_non_array_object, } from '@satisfactory-dev/predicates.ts';
2
2
  import { properties, } from './TypesDiscovery/JsonSchema/properties';
3
3
  import { non_empty_array_property, } from './TypesDiscovery/non_empty_array_property';
4
4
  import { $ref, } from './TypesDiscovery/JsonSchema/$ref';
@@ -74,4 +74,3 @@ export class TypesDiscovery {
74
74
  ];
75
75
  }
76
76
  }
77
- //# sourceMappingURL=TypesDiscovery.js.map
@@ -23,4 +23,3 @@ export const StringPassedRegExp = {
23
23
  ts.factory.createMappedTypeNode(undefined, ts.factory.createTypeParameterDeclaration(undefined, 'pseudo_key', type_reference_node('pattern')), undefined, undefined, create_type('never'), undefined),
24
24
  ])),
25
25
  };
26
- //# sourceMappingURL=validators.js.map
@@ -50,4 +50,3 @@ export class ImportTracker {
50
50
  }
51
51
  }
52
52
  }
53
- //# sourceMappingURL=TypesGeneration.js.map
package/lib/__dirname.js CHANGED
@@ -3,4 +3,3 @@ import { fileURLToPath, } from "node:url";
3
3
  export function __dirname_from_meta(meta) {
4
4
  return fileURLToPath(dirname(meta.url));
5
5
  }
6
- //# sourceMappingURL=__dirname.js.map
@@ -0,0 +1,2 @@
1
+ export * from './DocsTsGenerator';
2
+ export * from './TypeDefinitionWriter';
@@ -0,0 +1,2 @@
1
+ export * from './DocsTsGenerator';
2
+ export * from './TypeDefinitionWriter';
package/lib/helpers.js CHANGED
@@ -26,4 +26,3 @@ export const skip_because_docs_dot_json_not_yet_bundled = {
26
26
  ? false
27
27
  : 'Docs.json not yet bundled!',
28
28
  };
29
- //# sourceMappingURL=helpers.js.map
package/lib/index.d.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  export * from './AjvUtilities';
2
- export * from './ArrayUtilities';
3
2
  export * from './CustomParsingTypes/CustomPairingTypes';
4
- export * from './DocsTsGenerator';
5
3
  export * from './DocsValidation';
6
4
  export * from './Exceptions';
7
5
  export * from './StringStartsWith';
8
- export * from './TypeDefinitionWriter';
9
- export * from '../setup_PerformanceObserver';
package/lib/index.js CHANGED
@@ -1,10 +1,5 @@
1
1
  export * from './AjvUtilities';
2
- export * from './ArrayUtilities';
3
2
  export * from './CustomParsingTypes/CustomPairingTypes';
4
- export * from './DocsTsGenerator';
5
3
  export * from './DocsValidation';
6
4
  export * from './Exceptions';
7
5
  export * from './StringStartsWith';
8
- export * from './TypeDefinitionWriter';
9
- export * from '../setup_PerformanceObserver';
10
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@satisfactory-dev/custom-assert": "^0.2.2",
22
+ "@signpostmarv/setup-performance-observer": "^0.1.2",
22
23
  "@signpostmarv/ts-assert": "^0.3.0",
23
24
  "@types/eslint": "^8.56.6",
24
25
  "@types/node": "^20.11.20",
@@ -26,6 +27,7 @@
26
27
  "ts-node": "^10.9.2"
27
28
  },
28
29
  "dependencies": {
30
+ "@satisfactory-dev/predicates.ts": "^0.1.0",
29
31
  "ajv": "^8.12.0",
30
32
  "eslint": "^8.57.0",
31
33
  "glob": "^10.3.10",
@@ -33,5 +35,5 @@
33
35
  "typescript": "~5.5.2",
34
36
  "typescript-eslint": "^7.3.1"
35
37
  },
36
- "version": "0.6.4"
38
+ "version": "0.7.0"
37
39
  }
@@ -1,5 +1,5 @@
1
+ import setup from '@signpostmarv/setup-performance-observer';
1
2
  export function setup_PerformanceObserver(clear_lines = true) {
2
- const measure_totals = {};
3
3
  const tweak_order_by_prefix = [
4
4
  'bootstrap',
5
5
  'ajv compile',
@@ -9,47 +9,11 @@ export function setup_PerformanceObserver(clear_lines = true) {
9
9
  'Ref.',
10
10
  'TypedStringConverter.',
11
11
  ];
12
- let last_total_lines = 0;
13
- const obs = new PerformanceObserver((list) => {
14
- for (const entry of list.getEntries()) {
15
- if (!(entry.name in measure_totals)) {
16
- measure_totals[entry.name] = [0, 0];
17
- }
18
- measure_totals[entry.name][0] += entry.duration;
19
- measure_totals[entry.name][1] += 1;
20
- }
21
- const results = Object.entries(measure_totals).map((e) => {
22
- return [
23
- e[0],
24
- {
25
- 'total time': `${(e[1][0] / 1000).toFixed(4)}s`,
26
- amount: e[1][1],
27
- 'average per call': `${(e[1][0] / e[1][1]).toFixed(4)}ms`,
28
- },
29
- ];
30
- });
31
- if (clear_lines && last_total_lines) {
32
- process.stdout.moveCursor(0, 0 - (last_total_lines + 4));
33
- process.stdout.clearLine(1);
34
- }
35
- last_total_lines = results.length;
36
- console.table(Object.fromEntries(results.sort((a, b) => {
37
- const a_prefix = tweak_order_by_prefix.find(maybe => a[0].startsWith(maybe));
38
- const b_prefix = tweak_order_by_prefix.find(maybe => b[0].startsWith(maybe));
39
- if (a_prefix || b_prefix) {
40
- if (!b_prefix) {
41
- return -1;
42
- }
43
- else if (!a_prefix) {
44
- return 1;
45
- }
46
- return (tweak_order_by_prefix.indexOf(a_prefix) - tweak_order_by_prefix.indexOf(b_prefix));
47
- }
48
- return 0; // leave in order they came in
49
- })));
50
- performance.clearMeasures();
12
+ const instance = new setup({
13
+ clear_lines,
14
+ tweak_order_by_prefix,
51
15
  });
16
+ const obs = instance.obs;
52
17
  obs.observe({ entryTypes: ['measure'], buffered: true });
53
- return () => measure_totals;
18
+ return () => instance.measured_totals;
54
19
  }
55
- //# sourceMappingURL=setup_PerformanceObserver.js.map
@@ -1,24 +0,0 @@
1
- /**
2
- * Created due to annoyance over array.prototype.map()
3
- * forcing [unknown, ...unknown[]] to unknown[]
4
- */
5
- export declare function non_empty_map<ItemInput = unknown, ItemOutput = unknown, Input extends [ItemInput, ...ItemInput[]] = [ItemInput, ...ItemInput[]], Output extends [
6
- ItemOutput,
7
- ...ItemOutput[]
8
- ] = [
9
- ItemOutput,
10
- ...ItemOutput[]
11
- ]>(array: Input, map: (item: ItemInput) => ItemOutput): Output;
12
- type NonEmpty<T> = keyof T extends never ? never : T;
13
- export declare function non_empty_keys<T extends {
14
- [key: string]: unknown;
15
- } = {
16
- [key: string]: unknown;
17
- }>(object: NonEmpty<T>): [string, ...string[]];
18
- export declare function require_non_empty_array<Item = unknown, NotEmpty = [Item, ...Item[]]>(maybe: Item[]): NotEmpty;
19
- export declare function object_keys<T extends {
20
- [key: string]: unknown;
21
- } = {
22
- [key: string]: unknown;
23
- }>(object: T): (keyof T)[];
24
- export {};
@@ -1,21 +0,0 @@
1
- /**
2
- * Created due to annoyance over array.prototype.map()
3
- * forcing [unknown, ...unknown[]] to unknown[]
4
- */
5
- export function non_empty_map(array, map) {
6
- return array.map(map);
7
- }
8
- export function non_empty_keys(object) {
9
- return Object.keys(object);
10
- }
11
- export function require_non_empty_array(maybe) {
12
- if (maybe.length < 1) {
13
- throw new Error('Array is empty!');
14
- }
15
- return maybe;
16
- }
17
- // because typescript doesn't do this automatically
18
- export function object_keys(object) {
19
- return Object.keys(object);
20
- }
21
- //# sourceMappingURL=ArrayUtilities.js.map