@tsed/di 6.86.2 → 6.87.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.
@@ -32,7 +32,7 @@ export declare class Container extends LocalsContainer<Provider> {
32
32
  * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
33
33
  * @param token
34
34
  */
35
- getProvider(token: TokenProvider): Provider | undefined;
35
+ getProvider<T extends Provider = Provider>(token: TokenProvider): T | undefined;
36
36
  /**
37
37
  * Get all providers registered in the injector container.
38
38
  *
package/lib/index.js CHANGED
@@ -286,11 +286,11 @@ class GlobalProviderRegistry extends Map {
286
286
  return this;
287
287
  }
288
288
 
289
- onInvoke(provider, locals, deps) {
289
+ onInvoke(provider, locals, options) {
290
290
  const settings = _classPrivateFieldLooseBase(this, _settings)[_settings].get(provider.type);
291
291
 
292
292
  if (settings != null && settings.onInvoke) {
293
- settings.onInvoke(provider, locals, deps);
293
+ settings.onInvoke(provider, locals, options);
294
294
  }
295
295
  }
296
296
 
@@ -2174,16 +2174,19 @@ exports.InjectorService = InjectorService_1 = class InjectorService extends Cont
2174
2174
 
2175
2175
 
2176
2176
  resolve(target, locals, options = {}) {
2177
+ const resolvedOpts = this.mapInvokeOptions(target, locals, options);
2177
2178
  const {
2178
2179
  token,
2179
2180
  deps,
2180
2181
  construct,
2181
2182
  imports,
2182
2183
  provider
2183
- } = this.mapInvokeOptions(target, locals, options);
2184
+ } = resolvedOpts;
2184
2185
 
2185
2186
  if (provider) {
2186
- GlobalProviders.onInvoke(provider, locals, deps);
2187
+ GlobalProviders.onInvoke(provider, locals, _extends({}, resolvedOpts, {
2188
+ injector: this
2189
+ }));
2187
2190
  }
2188
2191
 
2189
2192
  let instance;