@loopback/context
Advanced tools
Comparing version 5.0.3 to 5.0.4
@@ -469,3 +469,3 @@ /// <reference types="node" /> | ||
*/ | ||
toClass(ctor: Constructor<T>): this; | ||
toClass<C extends T & object>(ctor: Constructor<C>): this; | ||
/** | ||
@@ -472,0 +472,0 @@ * Bind to a class optionally decorated with `@injectable`. Based on the |
@@ -16,3 +16,3 @@ import { Context } from './context'; | ||
*/ | ||
export declare function instantiateClass<T>(ctor: Constructor<T>, ctx: Context, session?: ResolutionSession, nonInjectedArgs?: any[]): ValueOrPromise<T>; | ||
export declare function instantiateClass<T extends object>(ctor: Constructor<T>, ctx: Context, session?: ResolutionSession, nonInjectedArgs?: any[]): ValueOrPromise<T>; | ||
/** | ||
@@ -19,0 +19,0 @@ * Given a function with arguments decorated with `@inject`, |
{ | ||
"name": "@loopback/context", | ||
"description": "Facilities to manage artifacts and their dependencies in your Node.js applications. The module exposes TypeScript/JavaScript APIs and decorators to register artifacts, declare dependencies, and resolve artifacts by keys. It also serves as an IoC container to support dependency injection", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"keywords": [ | ||
@@ -46,3 +46,3 @@ "LoopBack", | ||
"dependencies": { | ||
"@loopback/metadata": "^5.0.3", | ||
"@loopback/metadata": "^5.0.4", | ||
"@types/debug": "^4.1.7", | ||
@@ -53,14 +53,14 @@ "debug": "^4.3.4", | ||
"tslib": "^2.4.0", | ||
"uuid": "^8.3.2" | ||
"uuid": "^9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@loopback/build": "^9.0.3", | ||
"@loopback/eslint-config": "^13.0.3", | ||
"@loopback/testlab": "^5.0.3", | ||
"@types/bluebird": "^3.5.36", | ||
"@types/node": "^14.18.26", | ||
"@loopback/build": "^9.0.4", | ||
"@loopback/eslint-config": "^13.0.4", | ||
"@loopback/testlab": "^5.0.4", | ||
"@types/bluebird": "^3.5.37", | ||
"@types/node": "^14.18.32", | ||
"@types/uuid": "^8.3.4", | ||
"bluebird": "^3.7.2" | ||
}, | ||
"gitHead": "296d9a9577fd058d1a2b2386087686cefa65a7a9" | ||
"gitHead": "947500110c84ba77b2197b759b559c195cfce260" | ||
} |
@@ -111,3 +111,3 @@ // Copyright IBM Corp. and LoopBack contributors 2018,2020. All Rights Reserved. | ||
} else { | ||
binding.toClass(target as Constructor<T>); | ||
binding.toClass(target as Constructor<T & object>); | ||
} | ||
@@ -114,0 +114,0 @@ }; |
@@ -873,3 +873,3 @@ // Copyright IBM Corp. and LoopBack contributors 2017,2020. All Rights Reserved. | ||
*/ | ||
toClass(ctor: Constructor<T>): this { | ||
toClass<C extends T & object>(ctor: Constructor<C>): this { | ||
/* istanbul ignore if */ | ||
@@ -876,0 +876,0 @@ if (debug.enabled) { |
@@ -47,3 +47,3 @@ // Copyright IBM Corp. and LoopBack contributors 2017,2019. All Rights Reserved. | ||
*/ | ||
export function instantiateClass<T>( | ||
export function instantiateClass<T extends object>( | ||
ctor: Constructor<T>, | ||
@@ -85,3 +85,5 @@ ctx: Context, | ||
} | ||
return transformValueOrPromise(inst, obj => Object.assign(obj, props)); | ||
return transformValueOrPromise<T, T>(inst, obj => | ||
Object.assign(obj, props), | ||
); | ||
}); | ||
@@ -88,0 +90,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
663514
15791
+ Addeduuid@9.0.1(transitive)
Updated@loopback/metadata@^5.0.4
Updateduuid@^9.0.0