moost 0.5.17 → 0.5.18
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.
- package/dist/index.cjs +3 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +3 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -757,7 +757,9 @@ function InjectFromScope(name) {
|
|
|
757
757
|
function InjectScopeVars(name) {
|
|
758
758
|
return Resolve(({ scopeId }) => {
|
|
759
759
|
if (scopeId) {
|
|
760
|
-
return name
|
|
760
|
+
return name
|
|
761
|
+
? getInfactScopeVars(scopeId)?.[name]
|
|
762
|
+
: getInfactScopeVars(scopeId);
|
|
761
763
|
}
|
|
762
764
|
return undefined;
|
|
763
765
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -154,13 +154,13 @@ interface TCustom {
|
|
|
154
154
|
* @param name scope name
|
|
155
155
|
* @param scopeVars key-value object as scoped vars
|
|
156
156
|
*/
|
|
157
|
-
declare function defineInfactScope(name: string | symbol, scopeVars:
|
|
157
|
+
declare function defineInfactScope<T extends object>(name: string | symbol, scopeVars: T): void;
|
|
158
158
|
/**
|
|
159
159
|
* Read scoped vars defined with `defineInfactScope`
|
|
160
160
|
* @param name scope name
|
|
161
161
|
* @returns key-value object as scoped vars
|
|
162
162
|
*/
|
|
163
|
-
declare function getInfactScopeVars(name: string | symbol):
|
|
163
|
+
declare function getInfactScopeVars<T extends object>(name: string | symbol): T | undefined;
|
|
164
164
|
/**
|
|
165
165
|
* Get Infact instance (used for Dependency Injections)
|
|
166
166
|
*/
|
|
@@ -305,7 +305,7 @@ declare function Pipe(handler: TPipeFn, priority?: TPipePriority): ClassDecorato
|
|
|
305
305
|
* @param type - string or class constructor
|
|
306
306
|
* @param fn - factory function for provided value
|
|
307
307
|
*/
|
|
308
|
-
declare function Provide(type: string | TClassConstructor, fn: TProvideFn): ClassDecorator;
|
|
308
|
+
declare function Provide(type: string | TClassConstructor, fn: TProvideFn): ClassDecorator & ParameterDecorator & PropertyDecorator;
|
|
309
309
|
/**
|
|
310
310
|
* ## Replace
|
|
311
311
|
* ### @Decorator
|
package/dist/index.mjs
CHANGED
|
@@ -759,7 +759,9 @@ function InjectFromScope(name) {
|
|
|
759
759
|
function InjectScopeVars(name) {
|
|
760
760
|
return Resolve(({ scopeId }) => {
|
|
761
761
|
if (scopeId) {
|
|
762
|
-
return name
|
|
762
|
+
return name
|
|
763
|
+
? getInfactScopeVars(scopeId)?.[name]
|
|
764
|
+
: getInfactScopeVars(scopeId);
|
|
763
765
|
}
|
|
764
766
|
return undefined;
|
|
765
767
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moost",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.18",
|
|
4
4
|
"description": "moost",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prostojs"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@prostojs/infact": "^0.3.
|
|
34
|
+
"@prostojs/infact": "^0.3.3",
|
|
35
35
|
"@prostojs/mate": "^0.3.3",
|
|
36
36
|
"@prostojs/logger": "^0.4.3",
|
|
37
37
|
"@wooksjs/event-core": "^0.5.20",
|