patron-oop 1.39.1 → 1.41.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 (52) hide show
  1. package/.husky/pre-push +2 -0
  2. package/CHANGELOG.md +19 -0
  3. package/dist/patron.cjs +186 -96
  4. package/dist/patron.cjs.map +1 -1
  5. package/dist/patron.d.ts +21 -24
  6. package/dist/patron.js +185 -95
  7. package/dist/patron.js.map +1 -1
  8. package/dist/patron.min.js +1 -1
  9. package/dist/patron.min.mjs +1 -1
  10. package/dist/patron.min.mjs.map +1 -1
  11. package/dist/patron.mjs +185 -95
  12. package/dist/patron.mjs.map +1 -1
  13. package/eslint.config.mjs +6 -7
  14. package/package.json +7 -4
  15. package/src/Guest/Guest.ts +15 -2
  16. package/src/Guest/GuestAware.ts +26 -6
  17. package/src/Guest/GuestAwareActive.test.ts +5 -7
  18. package/src/Guest/GuestAwareActive.ts +12 -3
  19. package/src/Guest/GuestAwareMap.defered.test.ts +13 -15
  20. package/src/Guest/GuestAwareMap.fn.test.ts +6 -9
  21. package/src/Guest/GuestAwareMap.test.ts +8 -11
  22. package/src/Guest/GuestAwareMap.ts +24 -13
  23. package/src/Guest/GuestAwareRace.test.ts +8 -8
  24. package/src/Guest/GuestAwareRace.ts +12 -5
  25. package/src/Guest/GuestAwareSequence.defered.test.ts +20 -17
  26. package/src/Guest/GuestAwareSequence.test.ts +7 -10
  27. package/src/Guest/GuestAwareSequence.ts +31 -19
  28. package/src/Guest/GuestCast.test.ts +3 -3
  29. package/src/Guest/GuestCast.ts +10 -6
  30. package/src/Guest/GuestDisposable.ts +8 -1
  31. package/src/Guest/GuestObject.ts +6 -5
  32. package/src/Guest/GuestPool.test.ts +15 -2
  33. package/src/Guest/GuestSync.ts +5 -1
  34. package/src/Patron/Patron.ts +5 -1
  35. package/src/Patron/PatronOnce.sourceEmpty.test.ts +7 -4
  36. package/src/Patron/PatronOnce.test.ts +2 -2
  37. package/src/Patron/PatronOnce.ts +5 -1
  38. package/src/Patron/PatronPool.ts +6 -0
  39. package/src/Private/Private.test.ts +12 -0
  40. package/src/Private/Private.ts +20 -0
  41. package/src/Private/PrivateClass.modules.test.ts +33 -0
  42. package/src/Private/PrivateClass.test.ts +12 -0
  43. package/src/Private/PrivateClass.ts +29 -0
  44. package/src/Source/Source.ts +5 -1
  45. package/src/Source/SourceDynamic.ofSource.test.ts +4 -4
  46. package/src/Source/SourceDynamic.test.ts +2 -2
  47. package/src/Source/SourceDynamic.ts +9 -2
  48. package/src/index.ts +2 -2
  49. package/src/Factory/Factory.test.ts +0 -42
  50. package/src/Factory/Factory.ts +0 -30
  51. package/src/Factory/Module.test.ts +0 -12
  52. package/src/Factory/Module.ts +0 -12
@@ -0,0 +1,2 @@
1
+ npm test -- --run;
2
+ npm run lint;
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.41.0](https://github.com/kosukhin/patron/compare/v1.40.0...v1.41.0) (2025-02-22)
6
+
7
+
8
+ ### Features
9
+
10
+ * **issue-27:** assertions in constructors ([c8eeff4](https://github.com/kosukhin/patron/commit/c8eeff4e7737e07fe0b792d6304807a38b56d443))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **issue-27:** every constructor checks undefiend ([396e78b](https://github.com/kosukhin/patron/commit/396e78bb0451340e31cbff7d26eea062f476aea2))
16
+
17
+ ## [1.40.0](https://github.com/kosukhin/patron/compare/v1.39.1...v1.40.0) (2025-02-15)
18
+
19
+
20
+ ### Features
21
+
22
+ * **20-need-to-remove-factry-class-and-instead-create-moduleof---class-and-rename-factorytype-to-moduletype:** private type instead factory ([69c52c7](https://github.com/kosukhin/patron/commit/69c52c71fe166cc9550ad12f129e1a7fa5f50376))
23
+
5
24
  ### [1.39.1](https://github.com/kosukhin/patron/compare/v1.39.0...v1.39.1) (2025-01-24)
6
25
 
7
26
 
package/dist/patron.cjs CHANGED
@@ -1,6 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  function value(guestAware, guest) {
4
+ if (guestAware === void 0) {
5
+ throw new Error("value didnt receive guestAware argument");
6
+ }
7
+ if (guest === void 0) {
8
+ throw new Error("value didnt receive guest argument");
9
+ }
4
10
  if (typeof guestAware === "function") {
5
11
  return guestAware(guest);
6
12
  } else {
@@ -8,11 +14,17 @@ function value(guestAware, guest) {
8
14
  }
9
15
  }
10
16
  function isGuestAware(mbGuestAware) {
17
+ if (mbGuestAware === void 0) {
18
+ throw new Error("isGuestAware didnt receive mbGuestAware argument");
19
+ }
11
20
  return typeof mbGuestAware === "function" || typeof mbGuestAware?.value === "function";
12
21
  }
13
22
  class GuestAware {
14
23
  constructor(guestAware) {
15
24
  this.guestAware = guestAware;
25
+ if (guestAware === void 0) {
26
+ throw new Error("GuestAware constructor didnt receive executor function");
27
+ }
16
28
  }
17
29
  value(guest) {
18
30
  value(this.guestAware, guest);
@@ -21,6 +33,12 @@ class GuestAware {
21
33
  }
22
34
 
23
35
  function give(data, guest, options) {
36
+ if (data === void 0) {
37
+ throw new Error("give didnt receive data argument");
38
+ }
39
+ if (guest === void 0) {
40
+ throw new Error("give didnt receive guest argument");
41
+ }
24
42
  if (typeof guest === "function") {
25
43
  guest(data, options);
26
44
  } else {
@@ -28,11 +46,17 @@ function give(data, guest, options) {
28
46
  }
29
47
  }
30
48
  function isGuest(mbGuest) {
49
+ if (mbGuest === void 0) {
50
+ throw new Error("isGuest didnt receive mbGuest argument");
51
+ }
31
52
  return typeof mbGuest === "function" || typeof mbGuest?.give === "function";
32
53
  }
33
54
  class Guest {
34
55
  constructor(receiver) {
35
56
  this.receiver = receiver;
57
+ if (!receiver) {
58
+ throw new Error("reseiver function was not passed to Guest constructor");
59
+ }
36
60
  }
37
61
  give(value, options) {
38
62
  this.receiver(value, options);
@@ -40,10 +64,46 @@ class Guest {
40
64
  }
41
65
  }
42
66
 
67
+ var __defProp$6 = Object.defineProperty;
68
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
69
+ var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
70
+ class PatronOnce {
71
+ constructor(baseGuest) {
72
+ this.baseGuest = baseGuest;
73
+ __publicField$6(this, "received", false);
74
+ if (baseGuest === void 0) {
75
+ throw new Error("PatronOnce didnt receive baseGuest argument");
76
+ }
77
+ }
78
+ introduction() {
79
+ return "patron";
80
+ }
81
+ give(value, options) {
82
+ if (!this.received) {
83
+ this.received = true;
84
+ give(value, this.baseGuest, options);
85
+ }
86
+ return this;
87
+ }
88
+ disposed(value) {
89
+ if (this.received) {
90
+ return true;
91
+ }
92
+ const maybeDisposable = this.baseGuest;
93
+ return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;
94
+ }
95
+ }
96
+
43
97
  class GuestCast {
44
98
  constructor(sourceGuest, targetGuest) {
45
99
  this.sourceGuest = sourceGuest;
46
100
  this.targetGuest = targetGuest;
101
+ if (sourceGuest === void 0) {
102
+ throw new Error("GuestCast didnt receive sourceGuest argument");
103
+ }
104
+ if (targetGuest === void 0) {
105
+ throw new Error("GuestCast didnt receive targetGuest argument");
106
+ }
47
107
  }
48
108
  introduction() {
49
109
  if (typeof this.sourceGuest === "function") {
@@ -70,16 +130,22 @@ class GuestCast {
70
130
  }
71
131
  }
72
132
 
73
- var __defProp$6 = Object.defineProperty;
74
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
75
- var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
133
+ var __defProp$5 = Object.defineProperty;
134
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
135
+ var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
76
136
  const poolSets = /* @__PURE__ */ new Map();
77
137
  const removePatronFromPools = (patron) => {
138
+ if (patron === void 0) {
139
+ throw new Error("removePatronFromPools didnt receive patron argument");
140
+ }
78
141
  poolSets.forEach((pool) => {
79
142
  pool.delete(patron);
80
143
  });
81
144
  };
82
145
  const isPatronInPools = (patron) => {
146
+ if (patron === void 0) {
147
+ throw new Error("isPatronInPools didnt receive patron argument");
148
+ }
83
149
  let inPool = false;
84
150
  poolSets.forEach((pool) => {
85
151
  if (!inPool) {
@@ -91,8 +157,8 @@ const isPatronInPools = (patron) => {
91
157
  class PatronPool {
92
158
  constructor(initiator) {
93
159
  this.initiator = initiator;
94
- __publicField$6(this, "patrons");
95
- __publicField$6(this, "give");
160
+ __publicField$5(this, "patrons");
161
+ __publicField$5(this, "give");
96
162
  this.patrons = /* @__PURE__ */ new Set();
97
163
  poolSets.set(this, this.patrons);
98
164
  let lastMicrotask = null;
@@ -155,13 +221,16 @@ class PatronPool {
155
221
  }
156
222
  }
157
223
 
158
- var __defProp$5 = Object.defineProperty;
159
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
160
- var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
224
+ var __defProp$4 = Object.defineProperty;
225
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
226
+ var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, key + "" , value);
161
227
  class Source {
162
228
  constructor(sourceDocument) {
163
229
  this.sourceDocument = sourceDocument;
164
- __publicField$5(this, "thePool", new PatronPool(this));
230
+ __publicField$4(this, "thePool", new PatronPool(this));
231
+ if (sourceDocument === void 0) {
232
+ throw new Error("Source didnt receive sourceDocument argument");
233
+ }
165
234
  }
166
235
  pool() {
167
236
  return this.thePool;
@@ -181,9 +250,38 @@ class Source {
181
250
  }
182
251
  }
183
252
 
253
+ var __defProp$3 = Object.defineProperty;
254
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
255
+ var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, key + "" , value);
256
+ class SourceEmpty {
257
+ constructor() {
258
+ __publicField$3(this, "baseSource", new Source(null));
259
+ }
260
+ value(guest) {
261
+ this.baseSource.value(
262
+ new GuestCast(guest, (value, options) => {
263
+ if (value !== null) {
264
+ give(value, guest, options);
265
+ }
266
+ })
267
+ );
268
+ return this;
269
+ }
270
+ give(value) {
271
+ this.baseSource.give(value);
272
+ return this;
273
+ }
274
+ pool() {
275
+ return this.baseSource.pool();
276
+ }
277
+ }
278
+
184
279
  class GuestObject {
185
280
  constructor(baseGuest) {
186
281
  this.baseGuest = baseGuest;
282
+ if (baseGuest === void 0) {
283
+ throw new Error("GuestObject didnt receive baseGuest argument");
284
+ }
187
285
  }
188
286
  give(value, options) {
189
287
  let guest = this.baseGuest;
@@ -205,13 +303,13 @@ class GuestObject {
205
303
  }
206
304
  }
207
305
 
208
- var __defProp$4 = Object.defineProperty;
209
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
210
- var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
306
+ var __defProp$2 = Object.defineProperty;
307
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
308
+ var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
211
309
  class GuestPool {
212
310
  constructor(initiator) {
213
- __publicField$4(this, "guests", /* @__PURE__ */ new Set());
214
- __publicField$4(this, "patronPool");
311
+ __publicField$2(this, "guests", /* @__PURE__ */ new Set());
312
+ __publicField$2(this, "patronPool");
215
313
  this.patronPool = new PatronPool(initiator);
216
314
  }
217
315
  give(value, options) {
@@ -247,15 +345,15 @@ class GuestPool {
247
345
  }
248
346
  }
249
347
 
250
- var __defProp$3 = Object.defineProperty;
251
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
252
- var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
348
+ var __defProp$1 = Object.defineProperty;
349
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
350
+ var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
253
351
  class GuestAwareAll {
254
352
  constructor() {
255
- __publicField$3(this, "theAll");
256
- __publicField$3(this, "keysKnown", /* @__PURE__ */ new Set());
257
- __publicField$3(this, "keysFilled", /* @__PURE__ */ new Set());
258
- __publicField$3(this, "filledAllPool", new GuestPool(this));
353
+ __publicField$1(this, "theAll");
354
+ __publicField$1(this, "keysKnown", /* @__PURE__ */ new Set());
355
+ __publicField$1(this, "keysFilled", /* @__PURE__ */ new Set());
356
+ __publicField$1(this, "filledAllPool", new GuestPool(this));
259
357
  this.theAll = new Source({});
260
358
  }
261
359
  valueArray(guest) {
@@ -313,70 +411,21 @@ class GuestAwareAll {
313
411
  }
314
412
  }
315
413
 
316
- var __defProp$2 = Object.defineProperty;
317
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
318
- var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, key + "" , value);
319
- class SourceEmpty {
320
- constructor() {
321
- __publicField$2(this, "baseSource", new Source(null));
322
- }
323
- value(guest) {
324
- this.baseSource.value(
325
- new GuestCast(guest, (value, options) => {
326
- if (value !== null) {
327
- give(value, guest, options);
328
- }
329
- })
330
- );
331
- return this;
332
- }
333
- give(value) {
334
- this.baseSource.give(value);
335
- return this;
336
- }
337
- pool() {
338
- return this.baseSource.pool();
339
- }
340
- }
341
-
342
- var __defProp$1 = Object.defineProperty;
343
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
344
- var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "" , value);
345
- class PatronOnce {
346
- constructor(baseGuest) {
347
- this.baseGuest = baseGuest;
348
- __publicField$1(this, "received", false);
349
- }
350
- introduction() {
351
- return "patron";
352
- }
353
- give(value, options) {
354
- if (!this.received) {
355
- this.received = true;
356
- give(value, this.baseGuest, options);
357
- }
358
- return this;
359
- }
360
- disposed(value) {
361
- if (this.received) {
362
- return true;
363
- }
364
- const maybeDisposable = this.baseGuest;
365
- return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;
366
- }
367
- }
368
-
369
414
  class GuestAwareSequence {
370
- constructor(baseSource, targetSourceFactory) {
415
+ constructor(baseSource, targetSource) {
371
416
  this.baseSource = baseSource;
372
- this.targetSourceFactory = targetSourceFactory;
417
+ this.targetSource = targetSource;
418
+ if (baseSource === void 0) {
419
+ throw new Error("GuestAwareSequence didnt receive baseSource argument");
420
+ }
421
+ if (targetSource === void 0) {
422
+ throw new Error("GuestAwareSequence didnt receive targetSource argument");
423
+ }
373
424
  }
374
425
  value(guest) {
375
426
  const all = new GuestAwareAll();
376
427
  const sequenceSource = new SourceEmpty();
377
- const targetSource = this.targetSourceFactory.create(
378
- sequenceSource
379
- );
428
+ const targetSource = this.targetSource.get(sequenceSource);
380
429
  value(
381
430
  this.baseSource,
382
431
  new GuestCast(guest, (theValue) => {
@@ -393,11 +442,14 @@ class GuestAwareSequence {
393
442
  sequenceSource.give(null);
394
443
  const nextValue = theValue[index];
395
444
  if (isGuestAware(nextValue)) {
396
- value(nextValue, new PatronOnce((theNextValue) => {
397
- sequenceSource.give(theNextValue);
398
- value(targetSource, all.guestKey(index.toString()));
399
- nextItemHandle();
400
- }));
445
+ value(
446
+ nextValue,
447
+ new PatronOnce((theNextValue) => {
448
+ sequenceSource.give(theNextValue);
449
+ value(targetSource, all.guestKey(index.toString()));
450
+ nextItemHandle();
451
+ })
452
+ );
401
453
  } else {
402
454
  sequenceSource.give(nextValue);
403
455
  value(targetSource, all.guestKey(index.toString()));
@@ -416,9 +468,15 @@ class GuestAwareSequence {
416
468
  }
417
469
 
418
470
  class GuestAwareMap {
419
- constructor(baseSource, targetSourceFactory) {
471
+ constructor(baseSource, targetSource) {
420
472
  this.baseSource = baseSource;
421
- this.targetSourceFactory = targetSourceFactory;
473
+ this.targetSource = targetSource;
474
+ if (baseSource === void 0) {
475
+ throw new Error("GuestAwareMap didnt receive baseSource argument");
476
+ }
477
+ if (targetSource === void 0) {
478
+ throw new Error("GuestAwareMap didnt receive targetSource argument");
479
+ }
422
480
  }
423
481
  value(guest) {
424
482
  const all = new GuestAwareAll();
@@ -429,7 +487,7 @@ class GuestAwareMap {
429
487
  const valueSource = isGuestAware(val) ? val : new GuestAware((innerGuest) => {
430
488
  give(val, innerGuest);
431
489
  });
432
- const targetSource = this.targetSourceFactory.create(valueSource);
490
+ const targetSource = this.targetSource.get(valueSource);
433
491
  value(targetSource, all.guestKey(index.toString()));
434
492
  });
435
493
  })
@@ -442,6 +500,9 @@ class GuestAwareMap {
442
500
  class GuestAwareRace {
443
501
  constructor(guestAwares) {
444
502
  this.guestAwares = guestAwares;
503
+ if (guestAwares === void 0) {
504
+ throw new Error("GuestAwareRace didnt receive guestAwares argument");
505
+ }
445
506
  }
446
507
  value(guest) {
447
508
  let connectedWithGuestAware = null;
@@ -467,6 +528,11 @@ class GuestAwareActive {
467
528
  constructor(configExecutor) {
468
529
  this.configExecutor = configExecutor;
469
530
  __publicField(this, "source", new SourceEmpty());
531
+ if (configExecutor === void 0) {
532
+ throw new Error(
533
+ "GuestAwareActive constructor didnt receive executor function"
534
+ );
535
+ }
470
536
  }
471
537
  do(config) {
472
538
  this.configExecutor(config, this.source);
@@ -481,6 +547,9 @@ class GuestAwareActive {
481
547
  class GuestSync {
482
548
  constructor(theValue) {
483
549
  this.theValue = theValue;
550
+ if (theValue === void 0) {
551
+ throw new Error("GuestSync didnt receive theValue argument");
552
+ }
484
553
  }
485
554
  give(value) {
486
555
  this.theValue = value;
@@ -495,6 +564,12 @@ class GuestDisposable {
495
564
  constructor(guest, disposeCheck) {
496
565
  this.guest = guest;
497
566
  this.disposeCheck = disposeCheck;
567
+ if (guest === void 0) {
568
+ throw new Error("GuestDisposable didnt receive guest argument");
569
+ }
570
+ if (disposeCheck === void 0) {
571
+ throw new Error("GuestDisposable didnt receive disposeCheck argument");
572
+ }
498
573
  }
499
574
  disposed(value) {
500
575
  return this.disposeCheck(value);
@@ -508,6 +583,9 @@ class GuestDisposable {
508
583
  class Patron {
509
584
  constructor(willBePatron) {
510
585
  this.willBePatron = willBePatron;
586
+ if (willBePatron === void 0) {
587
+ throw new Error("Patron didnt receive willBePatron argument");
588
+ }
511
589
  }
512
590
  introduction() {
513
591
  return "patron";
@@ -526,6 +604,12 @@ class SourceDynamic {
526
604
  constructor(baseGuest, baseGuestAware) {
527
605
  this.baseGuest = baseGuest;
528
606
  this.baseGuestAware = baseGuestAware;
607
+ if (baseGuest === void 0) {
608
+ throw new Error("SourceDynamic didnt receive baseGuest argument");
609
+ }
610
+ if (baseGuestAware === void 0) {
611
+ throw new Error("SourceDynamic didnt receive baseGuestAware argument");
612
+ }
529
613
  }
530
614
  value(guest) {
531
615
  value(this.baseGuestAware, guest);
@@ -540,29 +624,34 @@ class SourceDynamic {
540
624
  }
541
625
  }
542
626
 
543
- class Factory {
544
- constructor(constructorFn, factories = {}) {
627
+ class PrivateClass {
628
+ constructor(constructorFn, modules = {}) {
545
629
  this.constructorFn = constructorFn;
546
- this.factories = factories;
630
+ this.modules = modules;
631
+ if (constructorFn === void 0) {
632
+ throw new Error("PrivateClass didnt receive constructorFn argument");
633
+ }
547
634
  }
548
- create(...args) {
635
+ get(...args) {
549
636
  return new this.constructorFn(
550
637
  ...args,
551
- this.factories
638
+ this.modules
552
639
  );
553
640
  }
554
641
  }
555
642
 
556
- class Module {
643
+ class Private {
557
644
  constructor(buildingFn) {
558
645
  this.buildingFn = buildingFn;
646
+ if (buildingFn === void 0) {
647
+ throw new Error("Private didnt receive buildingFn argument");
648
+ }
559
649
  }
560
- create(...args) {
650
+ get(...args) {
561
651
  return this.buildingFn(...args);
562
652
  }
563
653
  }
564
654
 
565
- exports.Factory = Factory;
566
655
  exports.Guest = Guest;
567
656
  exports.GuestAware = GuestAware;
568
657
  exports.GuestAwareActive = GuestAwareActive;
@@ -575,10 +664,11 @@ exports.GuestDisposable = GuestDisposable;
575
664
  exports.GuestObject = GuestObject;
576
665
  exports.GuestPool = GuestPool;
577
666
  exports.GuestSync = GuestSync;
578
- exports.Module = Module;
579
667
  exports.Patron = Patron;
580
668
  exports.PatronOnce = PatronOnce;
581
669
  exports.PatronPool = PatronPool;
670
+ exports.Private = Private;
671
+ exports.PrivateClass = PrivateClass;
582
672
  exports.Source = Source;
583
673
  exports.SourceDynamic = SourceDynamic;
584
674
  exports.SourceEmpty = SourceEmpty;