@moostjs/otel 0.4.23 → 0.5.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.
- package/dist/index.cjs +1 -15
- package/dist/index.mjs +1 -15
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -620,20 +620,6 @@ function useAsyncEventContext(expectedTypes) {
|
|
|
620
620
|
if (!cc) {
|
|
621
621
|
throw new Error('Event context does not exist at this point.');
|
|
622
622
|
}
|
|
623
|
-
if (expectedTypes || typeof expectedTypes === 'string') {
|
|
624
|
-
const type = cc.event.type;
|
|
625
|
-
const types = typeof expectedTypes === 'string' ? [expectedTypes] : expectedTypes;
|
|
626
|
-
if (!types.includes(type)) {
|
|
627
|
-
if (cc.parentCtx?.event.type && types.includes(cc.parentCtx.event.type)) {
|
|
628
|
-
cc = cc.parentCtx;
|
|
629
|
-
}
|
|
630
|
-
else {
|
|
631
|
-
throw new Error(`Event context type mismatch: expected ${types
|
|
632
|
-
.map(t => `"${t}"`)
|
|
633
|
-
.join(', ')}, received "${type}"`);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
623
|
return _getCtxHelpers(cc);
|
|
638
624
|
}
|
|
639
625
|
function _getCtxHelpers(cc) {
|
|
@@ -870,7 +856,7 @@ class Infact {
|
|
|
870
856
|
for (let i = 0; i < params.length; i++) {
|
|
871
857
|
const param = params[i];
|
|
872
858
|
if (param.inject) {
|
|
873
|
-
if (mergedProvide
|
|
859
|
+
if (mergedProvide[param.inject]) {
|
|
874
860
|
resolvedParams[i] = getProvidedValue(mergedProvide[param.inject]);
|
|
875
861
|
}
|
|
876
862
|
else if (param.nullable || param.optional) {
|
package/dist/index.mjs
CHANGED
|
@@ -618,20 +618,6 @@ function useAsyncEventContext(expectedTypes) {
|
|
|
618
618
|
if (!cc) {
|
|
619
619
|
throw new Error('Event context does not exist at this point.');
|
|
620
620
|
}
|
|
621
|
-
if (expectedTypes || typeof expectedTypes === 'string') {
|
|
622
|
-
const type = cc.event.type;
|
|
623
|
-
const types = typeof expectedTypes === 'string' ? [expectedTypes] : expectedTypes;
|
|
624
|
-
if (!types.includes(type)) {
|
|
625
|
-
if (cc.parentCtx?.event.type && types.includes(cc.parentCtx.event.type)) {
|
|
626
|
-
cc = cc.parentCtx;
|
|
627
|
-
}
|
|
628
|
-
else {
|
|
629
|
-
throw new Error(`Event context type mismatch: expected ${types
|
|
630
|
-
.map(t => `"${t}"`)
|
|
631
|
-
.join(', ')}, received "${type}"`);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
621
|
return _getCtxHelpers(cc);
|
|
636
622
|
}
|
|
637
623
|
function _getCtxHelpers(cc) {
|
|
@@ -868,7 +854,7 @@ class Infact {
|
|
|
868
854
|
for (let i = 0; i < params.length; i++) {
|
|
869
855
|
const param = params[i];
|
|
870
856
|
if (param.inject) {
|
|
871
|
-
if (mergedProvide
|
|
857
|
+
if (mergedProvide[param.inject]) {
|
|
872
858
|
resolvedParams[i] = getProvidedValue(mergedProvide[param.inject]);
|
|
873
859
|
}
|
|
874
860
|
else if (param.nullable || param.optional) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moostjs/otel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "@moostjs/otel",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@opentelemetry/api": "^1.9.0",
|
|
41
41
|
"@opentelemetry/sdk-trace-base": "^1.25.1",
|
|
42
|
-
"moost": "0.
|
|
42
|
+
"moost": "0.5.0"
|
|
43
43
|
}
|
|
44
44
|
}
|