typia 6.0.6 → 6.1.1-dev.20240620

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.
@@ -15,13 +15,13 @@ import { CommentFactory } from "./CommentFactory";
15
15
  import { TypeFactory } from "./TypeFactory";
16
16
 
17
17
  export class MetadataCollection {
18
- private readonly objects_: Map<ts.Type, MetadataObject>;
19
- private readonly object_unions_: Map<string, MetadataObject[]>;
20
- private readonly aliases_: Map<ts.Type, MetadataAlias>;
21
- private readonly arrays_: Map<ts.Type, MetadataArrayType>;
22
- private readonly tuples_: Map<ts.Type, MetadataTupleType>;
18
+ private objects_: Map<ts.Type, MetadataObject>;
19
+ private object_unions_: Map<string, MetadataObject[]>;
20
+ private aliases_: Map<ts.Type, MetadataAlias>;
21
+ private arrays_: Map<ts.Type, MetadataArrayType>;
22
+ private tuples_: Map<ts.Type, MetadataTupleType>;
23
23
 
24
- private readonly names_: Map<string, Map<ts.Type, string>>;
24
+ private names_: Map<string, Map<ts.Type, string>>;
25
25
  private object_index_: number;
26
26
  private recursive_array_index_: number;
27
27
  private recursive_tuple_index_: number;
@@ -41,6 +41,20 @@ export class MetadataCollection {
41
41
  this.recursive_tuple_index_ = 0;
42
42
  }
43
43
 
44
+ public clone(): MetadataCollection {
45
+ const output: MetadataCollection = new MetadataCollection();
46
+ output.objects_ = new Map(this.objects_);
47
+ output.object_unions_ = new Map(this.object_unions_);
48
+ output.aliases_ = new Map(this.aliases_);
49
+ output.arrays_ = new Map(this.arrays_);
50
+ output.tuples_ = new Map(this.tuples_);
51
+ output.names_ = new Map(this.names_);
52
+ output.object_index_ = this.object_index_;
53
+ output.recursive_array_index_ = this.recursive_array_index_;
54
+ output.recursive_tuple_index_ = this.recursive_tuple_index_;
55
+ return output;
56
+ }
57
+
44
58
  /* -----------------------------------------------------------
45
59
  ACCESSORS
46
60
  ----------------------------------------------------------- */
@@ -37,7 +37,7 @@ export const iterate_metadata_intersection =
37
37
  return false;
38
38
 
39
39
  // COSTRUCT FAKE METADATA LIST
40
- const fakeCollection: MetadataCollection = new MetadataCollection();
40
+ const fakeCollection: MetadataCollection = collection.clone();
41
41
  const fakeErrors: MetadataFactory.IError[] = [];
42
42
  const children: Metadata[] = [
43
43
  ...new Map(