@dits/dits
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -29,4 +29,2 @@ "use strict"; | ||
const originalFn = descriptor.value; | ||
// const injectParamsIdx: number[] = getInjectables(target, propertyKey) || [] | ||
// const dependencies = injectParamsIdx.map(idx => paramTypes[idx]) | ||
const dependencies = paramTypes; | ||
@@ -40,5 +38,3 @@ const metadata = Metadata_1.default.retrieveMetadata(target, propertyKey) || {}; | ||
predicates, | ||
// paramTypes, | ||
// injectParamsIdx, | ||
dependencies: dependencies.reverse(), | ||
dependencies, | ||
target, | ||
@@ -45,0 +41,0 @@ propertyKey, |
@@ -44,7 +44,6 @@ "use strict"; | ||
const results = [...args]; | ||
const container = container_1.default.fromZone(); | ||
declaration.dependencies | ||
.forEach((diType, idxOffByOne) => { | ||
const idx = idxOffByOne + 1; | ||
.forEach((diType, idx) => { | ||
if (results[idx] === null || results[idx] === undefined) { | ||
const container = container_1.default.fromZone(); | ||
const lookup = container.get(diType); | ||
@@ -61,3 +60,3 @@ // const lookup = REGISTRY.get(diType) | ||
else { | ||
log.info('no inject on ', idx, declaration.dependencies[idxOffByOne], results[idx]); | ||
process.env.DITS_DEBUG && log.info('no inject on ', idx, declaration.dependencies[idx], results[idx]); | ||
} | ||
@@ -64,0 +63,0 @@ }); |
@@ -6,2 +6,20 @@ "use strict"; | ||
const container_1 = (0, tslib_1.__importDefault)(require("../di/container")); | ||
const http_1 = (0, tslib_1.__importDefault)(require("http")); | ||
class DummyService { | ||
doTheThing() { | ||
return new Promise((resolve, reject) => { | ||
const options = { | ||
host: 'www.everra.com', | ||
path: '/integers/?num=1&min=1&max=10&col=1&base=10&format=plain&rnd=new' | ||
}; | ||
const data = []; | ||
http_1.default.request(options, res => { | ||
res.on('data', chunk => data.push(chunk)); | ||
res.on('end', () => resolve(data)); | ||
res.on('error', reject); | ||
}).end(); | ||
}); | ||
} | ||
} | ||
const dummy = new DummyService(); | ||
const simulateTest = async (parent) => { | ||
@@ -14,3 +32,4 @@ const app = parent.fork({ | ||
before = Zone.current.name; | ||
await Promise.resolve(); | ||
// await Promise.resolve() | ||
await dummy.doTheThing(); | ||
after = Zone.current.name; | ||
@@ -17,0 +36,0 @@ }); |
{ | ||
"name": "@dits/dits", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
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
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
Network access
Supply chain riskThis module accesses the network.
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
108194
1536
7
1