@bemoje/monorepo 1.2.0 → 1.2.1

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 (63) hide show
  1. package/lib/MonoRepo.cjs +7288 -60
  2. package/lib/MonoRepo.js +7267 -40
  3. package/lib/code/AbstractCode.cjs +5507 -16
  4. package/lib/code/AbstractCode.js +5500 -12
  5. package/lib/code/CodeBlock.cjs +5582 -19
  6. package/lib/code/CodeBlock.js +5574 -14
  7. package/lib/code/TsCode.cjs +7307 -27
  8. package/lib/code/TsCode.js +7295 -21
  9. package/lib/code/imports/ImportKeywords.cjs +5620 -10
  10. package/lib/code/imports/ImportKeywords.js +5614 -7
  11. package/lib/code/imports/ImportSpecifiers.cjs +5620 -10
  12. package/lib/code/imports/ImportSpecifiers.js +5614 -7
  13. package/lib/code/imports/ImportStatement.cjs +7321 -38
  14. package/lib/code/imports/ImportStatement.js +7301 -24
  15. package/lib/code/imports/ModuleSpecifier.cjs +7311 -16
  16. package/lib/code/imports/ModuleSpecifier.js +7299 -10
  17. package/lib/common/AbstractBase.cjs +570 -9
  18. package/lib/common/AbstractBase.js +565 -5
  19. package/lib/file/File.cjs +5424 -46
  20. package/lib/file/File.js +5419 -20
  21. package/lib/file/TestFile.cjs +7344 -18
  22. package/lib/file/TestFile.js +7334 -14
  23. package/lib/file/TsFile.cjs +7342 -20
  24. package/lib/file/TsFile.js +7331 -15
  25. package/lib/index.cjs +7695 -212
  26. package/lib/index.js +7672 -30
  27. package/lib/methods/findWorkspacePackageName.cjs +71 -2
  28. package/lib/methods/findWorkspacePackageName.js +66 -2
  29. package/lib/methods/getAllImports.cjs +2 -0
  30. package/lib/methods/getAllImports.js +3 -1
  31. package/lib/methods/getAllWorkspacePackageJsonPaths.cjs +42 -5
  32. package/lib/methods/getAllWorkspacePackageJsonPaths.js +40 -4
  33. package/lib/methods/getAllWorkspacePackageJsons.cjs +48 -2
  34. package/lib/methods/getAllWorkspacePackageJsons.js +47 -2
  35. package/lib/methods/getAllWorkspacePackageNames.cjs +62 -2
  36. package/lib/methods/getAllWorkspacePackageNames.js +57 -2
  37. package/lib/methods/getAllWorkspacePaths.cjs +32 -5
  38. package/lib/methods/getAllWorkspacePaths.js +30 -4
  39. package/lib/methods/getImportsRecursively.cjs +7422 -21
  40. package/lib/methods/getImportsRecursively.js +7412 -14
  41. package/lib/methods/getRepoPackageJson.cjs +25 -2
  42. package/lib/methods/getRepoPackageJson.js +24 -2
  43. package/lib/methods/getRepoPackageJsonPath.cjs +21 -4
  44. package/lib/methods/getRepoPackageJsonPath.js +20 -4
  45. package/lib/repo/Workspace.cjs +7059 -72
  46. package/lib/repo/Workspace.js +7034 -49
  47. package/lib/util/SemanticExtnamePrefix.cjs +2 -1
  48. package/lib/util/SemanticExtnamePrefix.js +2 -3
  49. package/lib/util/SemanticExtnamePrefixDescriptions.cjs +2 -1
  50. package/lib/util/SemanticExtnamePrefixDescriptions.js +2 -3
  51. package/lib/util/SemanticExtnamePrefixes.cjs +11 -2
  52. package/lib/util/SemanticExtnamePrefixes.js +10 -2
  53. package/lib/util/getRepoRootDirpath.cjs +1 -1
  54. package/lib/util/getRepoRootDirpath.js +3 -2
  55. package/lib/util/getWorkspaceDirpaths.cjs +18 -3
  56. package/lib/util/getWorkspaceDirpaths.js +18 -3
  57. package/lib/util/hasExtnamePrefix.cjs +15 -6
  58. package/lib/util/hasExtnamePrefix.js +17 -3
  59. package/lib/util/resolveModuleImportPath.cjs +24 -7
  60. package/lib/util/resolveModuleImportPath.js +22 -6
  61. package/lib/util/semverVersionBump.cjs +2 -0
  62. package/lib/util/semverVersionBump.js +3 -1
  63. package/package.json +2 -1
@@ -1,9 +1,572 @@
1
1
  'use strict';
2
2
 
3
- var composition = require('@mono/composition');
3
+ var object = require('es-toolkit/object');
4
+ var colors2 = require('ansi-colors');
5
+ var util = require('util');
6
+ var compat = require('es-toolkit/compat');
7
+ var esToolkit = require('es-toolkit');
8
+ var mnemonist = require('mnemonist');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var colors2__default = /*#__PURE__*/_interopDefault(colors2);
4
13
 
5
14
  var __defProp = Object.defineProperty;
6
15
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
16
+
17
+ // ../object/src/defineGetter.ts
18
+ function defineGetter(obj, key, get, des = {}) {
19
+ return Object.defineProperty(obj, key, {
20
+ configurable: true,
21
+ enumerable: false,
22
+ get,
23
+ ...des
24
+ });
25
+ }
26
+ __name(defineGetter, "defineGetter");
27
+
28
+ // ../object/src/defineValue.ts
29
+ function defineValue(obj, key, value, des = {}) {
30
+ return Object.defineProperty(obj, key, {
31
+ configurable: true,
32
+ value,
33
+ enumerable: true,
34
+ ...des
35
+ });
36
+ }
37
+ __name(defineValue, "defineValue");
38
+
39
+ // ../object/src/defineLazyProperty.ts
40
+ function defineLazyProperty(obj, key, get, des = {}) {
41
+ function getter() {
42
+ const value = get.call(this);
43
+ defineValue(this, key, value);
44
+ return value;
45
+ }
46
+ __name(getter, "getter");
47
+ return defineGetter(obj, key, getter, des);
48
+ }
49
+ __name(defineLazyProperty, "defineLazyProperty");
50
+
51
+ // ../object/src/defineMethod.ts
52
+ function defineMethod(obj, key, value, des = {}) {
53
+ return Object.defineProperty(obj, key, {
54
+ value,
55
+ configurable: true,
56
+ writable: true,
57
+ enumerable: false,
58
+ ...des
59
+ });
60
+ }
61
+ __name(defineMethod, "defineMethod");
62
+
63
+ // ../object/src/getClassChain.ts
64
+ function getClassChain(target, options) {
65
+ const ctor = typeof target === "function" ? target : target.constructor;
66
+ const result = [];
67
+ if (options?.includeSelf) {
68
+ result.push(ctor);
69
+ }
70
+ let current = ctor;
71
+ while (current = Reflect.getPrototypeOf(current)) {
72
+ if (current === Function.prototype || current === Object.prototype) {
73
+ result.push(Object);
74
+ break;
75
+ }
76
+ result.push(current);
77
+ }
78
+ return result;
79
+ }
80
+ __name(getClassChain, "getClassChain");
81
+
82
+ // ../object/src/hasOwnProperty.ts
83
+ function hasOwnProperty(object, key) {
84
+ return Object.prototype.hasOwnProperty.call(object, key);
85
+ }
86
+ __name(hasOwnProperty, "hasOwnProperty");
87
+
88
+ // ../object/src/hasPrototypeChainProperty.ts
89
+ function hasPrototypeChainProperty(object, key) {
90
+ return getClassChain(object).some((ctor) => {
91
+ return hasOwnProperty(ctor.prototype, key);
92
+ });
93
+ }
94
+ __name(hasPrototypeChainProperty, "hasPrototypeChainProperty");
95
+
96
+ // ../object/src/hasProperty.ts
97
+ function hasProperty(object, key) {
98
+ return hasOwnProperty(object, key) || hasPrototypeChainProperty(object, key);
99
+ }
100
+ __name(hasProperty, "hasProperty");
101
+
102
+ // ../composition/src/View.ts
103
+ var TARGET_SYMBOL = /* @__PURE__ */ Symbol("target");
104
+ var View = class {
105
+ static {
106
+ __name(this, "View");
107
+ }
108
+ [TARGET_SYMBOL];
109
+ constructor(target) {
110
+ this[TARGET_SYMBOL] = target;
111
+ }
112
+ get [Symbol.toStringTag]() {
113
+ return this.constructor.name;
114
+ }
115
+ get target() {
116
+ return this[TARGET_SYMBOL];
117
+ }
118
+ };
119
+
120
+ // ../composition/src/inspector/defaults/ignoreValuesFilterDefaults.ts
121
+ var ignoreValuesFilterDefaults = {
122
+ noFalse: /* @__PURE__ */ __name((value) => {
123
+ return value !== false;
124
+ }, "noFalse"),
125
+ noNull: /* @__PURE__ */ __name((value) => {
126
+ return value !== null;
127
+ }, "noNull"),
128
+ noUndefined: /* @__PURE__ */ __name((value) => {
129
+ return value !== void 0;
130
+ }, "noUndefined"),
131
+ noEmptyArray: /* @__PURE__ */ __name((value) => {
132
+ return !Array.isArray(value) || !!value.length;
133
+ }, "noEmptyArray"),
134
+ noEmptyObject: /* @__PURE__ */ __name((value) => {
135
+ return !value || typeof value !== "object" || Array.isArray(value) || !!Object.keys(value).length;
136
+ }, "noEmptyObject")
137
+ };
138
+
139
+ // ../composition/src/inspector/defaults/ignoreValuesDefaults.ts
140
+ var ignoreValuesDefaults = {
141
+ noEmptyArray: true,
142
+ noEmptyObject: true,
143
+ noNull: true,
144
+ noUndefined: true,
145
+ noFalse: false
146
+ };
147
+ var inspectDefaults = {
148
+ ...util.inspect.defaultOptions,
149
+ customInspect: true,
150
+ maxStringLength: 500,
151
+ maxArrayLength: 200,
152
+ breakLength: 100,
153
+ colors: true,
154
+ depth: 100,
155
+ compact: false,
156
+ numericSeparator: true
157
+ };
158
+
159
+ // ../composition/src/inspector/defaults/inspectorDefaults.ts
160
+ var inspectorDefaults = {
161
+ inspect: inspectDefaults,
162
+ ignoreValues: ignoreValuesDefaults,
163
+ keys: [],
164
+ autoAddBooleanKeys: false,
165
+ ignoreKeys: [],
166
+ filters: []
167
+ };
168
+ var Inspector = class _Inspector extends View {
169
+ static {
170
+ __name(this, "Inspector");
171
+ }
172
+ /**
173
+ * Composes a class with Inspector capabilities by adding inspection methods to its prototype.
174
+ * This follows the Composition pattern to extend classes without inheritance.
175
+ */
176
+ static compose(cls, options = {}) {
177
+ if (!hasProperty(cls.prototype, util.inspect.custom)) {
178
+ defineMethod(cls.prototype, util.inspect.custom, function(depth, options2) {
179
+ return this.inspector.inspect(depth, options2);
180
+ });
181
+ }
182
+ if (!hasProperty(cls.prototype, "inspector")) {
183
+ defineLazyProperty(cls.prototype, "inspector", /* @__PURE__ */ __name(function get() {
184
+ return new _Inspector(this);
185
+ }, "get"));
186
+ }
187
+ if (!hasProperty(cls.prototype, "toJSON")) {
188
+ defineMethod(cls.prototype, "toJSON", function() {
189
+ return this.inspector.toObject();
190
+ });
191
+ }
192
+ return options;
193
+ }
194
+ /**
195
+ * Compile the target object and return the output as an object.
196
+ */
197
+ toObject(depth = 0) {
198
+ const result = esToolkit.mapValues(this.compile(depth).output, (value) => {
199
+ if (!value) {
200
+ return value;
201
+ }
202
+ if (typeof value !== "object") {
203
+ return value;
204
+ }
205
+ if (Array.isArray(value)) {
206
+ return value.map((v) => {
207
+ if (v.inspector && v.inspector instanceof _Inspector) {
208
+ return v.inspector.toObject(depth + 1);
209
+ }
210
+ return v;
211
+ });
212
+ }
213
+ if (value.inspector && value.inspector instanceof _Inspector) {
214
+ return value.inspector.toObject(depth + 1);
215
+ }
216
+ return value;
217
+ });
218
+ return {
219
+ T: this.target.constructor.name,
220
+ ...result
221
+ };
222
+ }
223
+ /**
224
+ * Inspect the target object.
225
+ */
226
+ inspect(depth = 0, options = {}) {
227
+ const { output, inspectOptions } = this.compile(depth);
228
+ Object.assign(inspectOptions, options);
229
+ const result = util.inspect(output, options);
230
+ return result.replaceAll(/Object \[\w+] {/gm, (match) => {
231
+ match = match.substring(8, match.length - 3);
232
+ return `[${inspectOptions.colors ? colors2__default.default.magenta(match) : match}] {`;
233
+ });
234
+ }
235
+ /**
236
+ * Compiles the output object and inspect options.
237
+ * Merges prototype chain options and applies filters to determine which properties to include.
238
+ */
239
+ compile(depth = 0) {
240
+ const output = Object.defineProperty({}, Symbol.toStringTag, {
241
+ value: this.target.constructor.name,
242
+ configurable: true
243
+ });
244
+ const options = this.mergePrototypeOptions();
245
+ const keys = new Set(options.keys);
246
+ if (options.autoAddBooleanKeys) {
247
+ const insBooleanValueKeys = Object.entries(this.target).filter(([_key, value]) => {
248
+ return typeof value === "boolean";
249
+ }).map(([key]) => {
250
+ return key;
251
+ });
252
+ const protoGetterKeys = getClassChain(this.target, {
253
+ includeSelf: false
254
+ }).map((cls) => {
255
+ return Object.getOwnPropertyNames(cls.prototype).filter((key) => {
256
+ return hasOwnProperty(Reflect.getOwnPropertyDescriptor(cls.prototype, key), "get");
257
+ });
258
+ }).flat(2);
259
+ const booleanKeys = insBooleanValueKeys.concat(protoGetterKeys).filter((key) => {
260
+ return /^(is|was|has|should)[A-Z]/.test(key);
261
+ });
262
+ booleanKeys.forEach((key) => {
263
+ return keys.add(key);
264
+ });
265
+ }
266
+ const ignoreFilters = Object.entries(options.ignoreValues).filter(([_name, enabled]) => {
267
+ return enabled;
268
+ }).map(([name]) => {
269
+ return ignoreValuesFilterDefaults[name];
270
+ });
271
+ const objectValues = [];
272
+ const arrayValues = [];
273
+ for (const key of keys) {
274
+ const value = this.target[key];
275
+ if (!ignoreFilters.every((filter) => {
276
+ return filter(value);
277
+ })) {
278
+ continue;
279
+ }
280
+ if (!options.filters.every((filter) => {
281
+ return filter.call(this.target, value, key, depth, output);
282
+ })) {
283
+ continue;
284
+ }
285
+ if (Array.isArray(value)) {
286
+ arrayValues.push(() => {
287
+ return defineValue(output, key, value);
288
+ });
289
+ } else if (compat.isObjectLike(value)) {
290
+ objectValues.push(() => {
291
+ return defineValue(output, key, value);
292
+ });
293
+ } else {
294
+ defineValue(output, key, value);
295
+ }
296
+ }
297
+ objectValues.forEach((fn) => {
298
+ return fn();
299
+ });
300
+ arrayValues.forEach((fn) => {
301
+ return fn();
302
+ });
303
+ return {
304
+ output,
305
+ inspectOptions: options.inspect
306
+ };
307
+ }
308
+ /**
309
+ * Walks the prototype chain and merges Inspector options from all classes.
310
+ * Subclass options override superclass options following inheritance semantics.
311
+ */
312
+ mergePrototypeOptions() {
313
+ const defaults = this.getDefaults();
314
+ let inspectOptions = defaults.inspect;
315
+ const keys = new Set(defaults.keys);
316
+ let autoAddBooleanKeys = defaults.autoAddBooleanKeys;
317
+ const ignoreKeys = new Set(defaults.ignoreKeys);
318
+ const ignoreValues = defaults.ignoreValues;
319
+ const customFilters = defaults.filters;
320
+ const prototypeChainOptions = getClassChain(this.target.constructor, {
321
+ includeSelf: true
322
+ }).reverse().map((cls) => {
323
+ return cls.inspector ?? {};
324
+ });
325
+ for (const options of prototypeChainOptions) {
326
+ if (options.inspect) {
327
+ inspectOptions = {
328
+ ...inspectOptions,
329
+ ...options.inspect
330
+ };
331
+ }
332
+ options.keys?.forEach((elem) => {
333
+ return keys.add(elem);
334
+ });
335
+ if (options.autoAddBooleanKeys != null) {
336
+ autoAddBooleanKeys = options.autoAddBooleanKeys;
337
+ }
338
+ keys.forEach((elem) => {
339
+ return ignoreKeys.delete(elem);
340
+ });
341
+ options.ignoreKeys?.forEach((elem) => {
342
+ return ignoreKeys.add(elem);
343
+ });
344
+ ignoreKeys.forEach((elem) => {
345
+ return keys.delete(elem);
346
+ });
347
+ if (options.ignoreValues) {
348
+ Object.assign(ignoreValues, options.ignoreValues);
349
+ }
350
+ options.filters?.forEach((filter) => {
351
+ return customFilters.push(filter);
352
+ });
353
+ }
354
+ return {
355
+ inspect: inspectOptions,
356
+ ignoreValues,
357
+ autoAddBooleanKeys,
358
+ keys: Array.from(keys),
359
+ ignoreKeys: Array.from(ignoreKeys),
360
+ filters: customFilters
361
+ };
362
+ }
363
+ /**
364
+ * Returns a deep clone of the default Inspector options.
365
+ */
366
+ getDefaults() {
367
+ const filters = inspectorDefaults.filters.slice();
368
+ const rest = object.cloneDeep(compat.omit(inspectorDefaults, "filters"));
369
+ return {
370
+ ...rest,
371
+ filters
372
+ };
373
+ }
374
+ };
375
+ var ParentRelationTypes = class _ParentRelationTypes extends View {
376
+ static {
377
+ __name(this, "ParentRelationTypes");
378
+ }
379
+ registerParent(parentType) {
380
+ _ParentRelationTypes.parentTypesStats.get(this.target).add(parentType);
381
+ _ParentRelationTypes.childTypesStats.get(parentType).add(this.target);
382
+ }
383
+ get hasParent() {
384
+ return _ParentRelationTypes.parentTypesStats.has(this.target);
385
+ }
386
+ get getParentTypes() {
387
+ return _ParentRelationTypes.parentTypesStats.get(this.target);
388
+ }
389
+ get hasChildren() {
390
+ return _ParentRelationTypes.childTypesStats.has(this.target);
391
+ }
392
+ get getChildTypes() {
393
+ return _ParentRelationTypes.childTypesStats.get(this.target);
394
+ }
395
+ get isRoot() {
396
+ return !this.hasParent && this.hasChildren;
397
+ }
398
+ get isLeaf() {
399
+ return this.hasParent && !this.hasChildren;
400
+ }
401
+ get isIsolated() {
402
+ return !this.hasParent && !this.hasChildren;
403
+ }
404
+ static getAllChildTypesStats() {
405
+ const res = {};
406
+ Array.from(this.childTypesStats.entries()).map(([cls, multimap]) => {
407
+ multimap.forEachMultiplicity((count, key) => {
408
+ if (!res[cls.name]) {
409
+ res[cls.name] = {};
410
+ }
411
+ if (!res[cls.name][key.name]) {
412
+ res[cls.name][key.name] = count;
413
+ }
414
+ });
415
+ });
416
+ return res;
417
+ }
418
+ static getAllParentTypesStats() {
419
+ const res = {};
420
+ Array.from(this.parentTypesStats.entries()).map(([cls, multimap]) => {
421
+ multimap.forEachMultiplicity((count, key) => {
422
+ if (!res[cls.name]) {
423
+ res[cls.name] = {};
424
+ }
425
+ if (!res[cls.name][key.name]) {
426
+ res[cls.name][key.name] = count;
427
+ }
428
+ });
429
+ });
430
+ return res;
431
+ }
432
+ static getAllStats() {
433
+ const classes = /* @__PURE__ */ new Set([
434
+ ...Array.from(this.childTypesStats.keys()),
435
+ ...Array.from(this.parentTypesStats.keys())
436
+ ]);
437
+ return Array.from(classes).map((cls) => {
438
+ const parents = Array.from(this.parentTypesStats.get(cls).multiplicities()).map(([cls2, count]) => {
439
+ return [
440
+ cls2.name,
441
+ count
442
+ ];
443
+ });
444
+ const children = Array.from(this.childTypesStats.get(cls).multiplicities()).map(([cls2, count]) => {
445
+ return [
446
+ cls2.name,
447
+ count
448
+ ];
449
+ });
450
+ const result = {
451
+ class: cls.name
452
+ };
453
+ if (parents.length) {
454
+ result.parents = Object.fromEntries(parents);
455
+ }
456
+ if (children.length) {
457
+ result.children = Object.fromEntries(children);
458
+ }
459
+ return result;
460
+ });
461
+ }
462
+ static printAllStats() {
463
+ console.log();
464
+ console.log(colors2__default.default.bold.yellow("Parent-Child Relation Stats"));
465
+ for (const stats of this.getAllStats()) {
466
+ console.log(stats.class);
467
+ if (stats.parents) {
468
+ let prefix = ` ${colors2__default.default.dim("parents : ")}`;
469
+ for (const [parent, count] of Object.entries(stats.parents)) {
470
+ console.log(`${prefix}${colors2__default.default.blue(parent)}: ${colors2__default.default.yellow(String(count))}`);
471
+ prefix = " ".repeat(12);
472
+ }
473
+ }
474
+ if (stats.children) {
475
+ let prefix = ` ${colors2__default.default.dim("children : ")}`;
476
+ for (const [child, count] of Object.entries(stats.children)) {
477
+ console.log(`${prefix}${colors2__default.default.green(child)}: ${colors2__default.default.yellow(String(count))}`);
478
+ prefix = " ".repeat(12);
479
+ }
480
+ }
481
+ console.log();
482
+ }
483
+ }
484
+ static childTypesStats = new mnemonist.DefaultMap(() => {
485
+ return new mnemonist.MultiSet();
486
+ });
487
+ static parentTypesStats = new mnemonist.DefaultMap(() => {
488
+ return new mnemonist.MultiSet();
489
+ });
490
+ };
491
+ var Parenting = class _Parenting extends View {
492
+ static {
493
+ __name(this, "Parenting");
494
+ }
495
+ /**
496
+ * Class decorator to register and correctly initialize a class as a 'parentingTarget'.
497
+ */
498
+ static compose(cls) {
499
+ if (!hasProperty(cls, "parenting")) {
500
+ defineLazyProperty(cls, "parenting", function() {
501
+ return new ParentRelationTypes(this);
502
+ });
503
+ }
504
+ if (!hasProperty(cls.prototype, "parenting")) {
505
+ defineLazyProperty(cls.prototype, "parenting", function() {
506
+ return new _Parenting(this);
507
+ });
508
+ }
509
+ }
510
+ /**
511
+ * Store a weak refences to the target object's parent.
512
+ */
513
+ onInstance(parent) {
514
+ if (!parent) {
515
+ return;
516
+ }
517
+ const targetClass = this.parentingTargetConstructor;
518
+ _Parenting.parentWeakRefMap.get(targetClass).set(this.target, parent);
519
+ targetClass.parenting?.registerParent(parent.constructor);
520
+ }
521
+ /**
522
+ * Retrieve the parent object of 'target' object.
523
+ */
524
+ getParent() {
525
+ const map = _Parenting.parentWeakRefMap.get(this.parentingTargetConstructor);
526
+ const parent = map.get(this.target);
527
+ return parent;
528
+ }
529
+ /**
530
+ * Recursively get parent until no parent is found or a circular reference is detected.
531
+ */
532
+ *iterateAncestors() {
533
+ let node = this.target.parenting.getParent();
534
+ if (!node) {
535
+ return;
536
+ }
537
+ const seen = /* @__PURE__ */ new Set();
538
+ while (node) {
539
+ if (seen.has(node)) {
540
+ return;
541
+ }
542
+ seen.add(node);
543
+ yield node;
544
+ node = node?.parenting?.getParent();
545
+ }
546
+ }
547
+ /**
548
+ * The depth of the object in the parent-child hierarchy.
549
+ */
550
+ get depth() {
551
+ return [
552
+ ...this.iterateAncestors()
553
+ ].length;
554
+ }
555
+ /**
556
+ * The class constructor of the target object.
557
+ */
558
+ get parentingTargetConstructor() {
559
+ return this.target.constructor;
560
+ }
561
+ /**
562
+ * A WeakMap for parent references.
563
+ */
564
+ static parentWeakRefMap = new mnemonist.DefaultMap(() => {
565
+ return /* @__PURE__ */ new WeakMap();
566
+ });
567
+ };
568
+
569
+ // src/common/AbstractBase.ts
7
570
  function _ts_decorate(decorators, target, key, desc) {
8
571
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
572
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -15,11 +578,11 @@ function _ts_metadata(k, v) {
15
578
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16
579
  }
17
580
  __name(_ts_metadata, "_ts_metadata");
18
- class AbstractBase {
581
+ exports.AbstractBase = class _AbstractBase {
19
582
  static {
20
583
  __name(this, "AbstractBase");
21
584
  }
22
- static inspector = composition.Inspector.compose(AbstractBase, {
585
+ static inspector = Inspector.compose(_AbstractBase, {
23
586
  keys: [],
24
587
  autoAddBooleanKeys: true,
25
588
  ignoreKeys: [],
@@ -65,13 +628,11 @@ class AbstractBase {
65
628
  }
66
629
  return parent;
67
630
  }
68
- }
69
- AbstractBase = _ts_decorate([
70
- composition.Parenting.compose,
631
+ };
632
+ exports.AbstractBase = _ts_decorate([
633
+ Parenting.compose,
71
634
  _ts_metadata("design:type", Function),
72
635
  _ts_metadata("design:paramtypes", [
73
636
  typeof P === "undefined" ? Object : P
74
637
  ])
75
- ], AbstractBase);
76
-
77
- exports.AbstractBase = AbstractBase;
638
+ ], exports.AbstractBase);