@loopback/context
Advanced tools
Comparing version 6.1.1 to 6.1.2
@@ -122,3 +122,4 @@ "use strict"; | ||
debug('class %s has binding metadata', cls.name, spec); | ||
const templateFunctions = (_a = spec === null || spec === void 0 ? void 0 : spec.templates) !== null && _a !== void 0 ? _a : []; | ||
// Clone the templates array to avoid updating the cached metadata | ||
const templateFunctions = [...((_a = spec === null || spec === void 0 ? void 0 : spec.templates) !== null && _a !== void 0 ? _a : [])]; | ||
if ((spec === null || spec === void 0 ? void 0 : spec.target) !== cls) { | ||
@@ -125,0 +126,0 @@ // Make sure the subclass is used as the binding source |
@@ -9,9 +9,7 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const events_1 = require("events"); | ||
const debug_1 = tslib_1.__importDefault(require("debug")); | ||
const events_1 = require("events"); | ||
const util_1 = require("util"); | ||
const resolution_session_1 = require("./resolution-session"); | ||
const value_promise_1 = require("./value-promise"); | ||
const debug = (0, debug_1.default)('loopback:context:view'); | ||
const nextTick = (0, util_1.promisify)(process.nextTick); | ||
/** | ||
@@ -189,3 +187,5 @@ * `ContextView` provides a view for a given context chain to maintain a live | ||
// Wait for the next tick so that context event notification can be emitted | ||
await nextTick(); | ||
await new Promise(resolve => { | ||
process.nextTick(() => resolve()); | ||
}); | ||
if (this._cachedValues == null) { | ||
@@ -192,0 +192,0 @@ return this.resolve(session); |
{ | ||
"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": "6.1.1", | ||
"version": "6.1.2", | ||
"keywords": [ | ||
@@ -46,3 +46,3 @@ "LoopBack", | ||
"dependencies": { | ||
"@loopback/metadata": "^6.1.1", | ||
"@loopback/metadata": "^6.1.2", | ||
"@types/debug": "^4.1.8", | ||
@@ -52,15 +52,15 @@ "debug": "^4.3.4", | ||
"p-event": "^4.2.0", | ||
"tslib": "^2.6.0", | ||
"tslib": "^2.6.1", | ||
"uuid": "^9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@loopback/build": "^10.1.1", | ||
"@loopback/eslint-config": "^14.0.2", | ||
"@loopback/testlab": "^6.1.1", | ||
"@loopback/build": "^10.1.2", | ||
"@loopback/eslint-config": "^14.0.3", | ||
"@loopback/testlab": "^6.1.2", | ||
"@types/bluebird": "^3.5.38", | ||
"@types/node": "^16.18.38", | ||
"@types/node": "^16.18.40", | ||
"@types/uuid": "^9.0.2", | ||
"bluebird": "^3.7.2" | ||
}, | ||
"gitHead": "be0c53e30bbe9edf7753c4fcd7ab3199f7cd3b8c" | ||
"gitHead": "0e9d6114999bd4d53969071e49bec5f6680ae9ad" | ||
} |
@@ -177,3 +177,4 @@ // Copyright IBM Corp. and LoopBack contributors 2018,2020. All Rights Reserved. | ||
debug('class %s has binding metadata', cls.name, spec); | ||
const templateFunctions = spec?.templates ?? []; | ||
// Clone the templates array to avoid updating the cached metadata | ||
const templateFunctions = [...(spec?.templates ?? [])]; | ||
if (spec?.target !== cls) { | ||
@@ -180,0 +181,0 @@ // Make sure the subclass is used as the binding source |
@@ -409,3 +409,6 @@ // Copyright IBM Corp. and LoopBack contributors 2017,2020. All Rights Reserved. | ||
constructor(key: BindingAddress<T>, public isLocked: boolean = false) { | ||
constructor( | ||
key: BindingAddress<T>, | ||
public isLocked: boolean = false, | ||
) { | ||
super(); | ||
@@ -412,0 +415,0 @@ BindingKey.validate(key); |
@@ -6,5 +6,4 @@ // Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved. | ||
import {EventEmitter} from 'events'; | ||
import debugFactory from 'debug'; | ||
import {EventEmitter} from 'events'; | ||
import {promisify} from 'util'; | ||
import {Binding} from './binding'; | ||
@@ -25,4 +24,4 @@ import {BindingFilter} from './binding-filter'; | ||
import {isPromiseLike, resolveList, ValueOrPromise} from './value-promise'; | ||
const debug = debugFactory('loopback:context:view'); | ||
const nextTick = promisify(process.nextTick); | ||
@@ -239,3 +238,5 @@ /** | ||
// Wait for the next tick so that context event notification can be emitted | ||
await nextTick(); | ||
await new Promise<void>(resolve => { | ||
process.nextTick(() => resolve()); | ||
}); | ||
if (this._cachedValues == null) { | ||
@@ -242,0 +243,0 @@ return this.resolve(session); |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
663452
15805
Updated@loopback/metadata@^6.1.2
Updatedtslib@^2.6.1