patron-oop 1.27.0 → 1.29.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/dist/patron.cjs +5 -5
- package/dist/patron.cjs.map +1 -1
- package/dist/patron.d.ts +75 -24
- package/dist/patron.js +5 -5
- package/dist/patron.js.map +1 -1
- package/dist/patron.min.js +1 -1
- package/dist/patron.min.mjs +1 -1
- package/dist/patron.min.mjs.map +1 -1
- package/dist/patron.mjs +5 -5
- package/dist/patron.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Factory/Factory.test.ts +2 -2
- package/src/Factory/Factory.ts +5 -2
- package/src/Factory/Module.test.ts +14 -0
- package/src/Factory/Module.ts +12 -0
- package/src/Guest/Guest.ts +6 -0
- package/src/Guest/GuestAware.ts +3 -0
- package/src/Guest/GuestCast.ts +6 -3
- package/src/Guest/GuestChain.ts +3 -0
- package/src/Guest/GuestDisposable.ts +3 -0
- package/src/Guest/GuestObject.ts +5 -2
- package/src/Guest/GuestPool.ts +3 -0
- package/src/Guest/GuestSync.ts +3 -0
- package/src/Patron/Patron.ts +4 -1
- package/src/Patron/PatronOnce.ts +5 -2
- package/src/Patron/PatronPool.ts +9 -2
- package/src/Source/Source.ts +3 -0
- package/src/Source/SourceEmpty.ts +4 -1
- package/src/index.ts +1 -1
- package/src/Factory/FactoryDynamic.ts +0 -11
@@ -1,11 +0,0 @@
|
|
1
|
-
import { FactoryType } from "./Factory";
|
2
|
-
|
3
|
-
export class FactoryDynamic<T> implements FactoryType<T> {
|
4
|
-
public constructor(private creationFn: (...args: unknown[]) => T) {}
|
5
|
-
|
6
|
-
public create<R extends unknown[], CT = null>(
|
7
|
-
...args: R
|
8
|
-
): CT extends null ? T : CT {
|
9
|
-
return this.creationFn(...args) as CT extends null ? T : CT;
|
10
|
-
}
|
11
|
-
}
|