rian 0.0.2-alpha.8 → 0.0.2-alpha.9
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -3
- package/index.mjs +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
@@ -9,8 +9,8 @@ const measure = (cb, scope, promises) => {
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
try {
|
12
|
-
|
13
|
-
if (
|
12
|
+
var r = cb(), is_promise = r instanceof Promise;
|
13
|
+
if (is_promise)
|
14
14
|
promises.push(r.catch(set_error).finally(() => scope.end()));
|
15
15
|
return r;
|
16
16
|
}
|
@@ -19,7 +19,8 @@ const measure = (cb, scope, promises) => {
|
|
19
19
|
throw e;
|
20
20
|
}
|
21
21
|
finally {
|
22
|
-
|
22
|
+
if (is_promise !== true)
|
23
|
+
scope.end();
|
23
24
|
}
|
24
25
|
};
|
25
26
|
const create = (name, options) => {
|
package/index.mjs
CHANGED
@@ -7,8 +7,8 @@ const measure = (cb, scope, promises) => {
|
|
7
7
|
});
|
8
8
|
};
|
9
9
|
try {
|
10
|
-
|
11
|
-
if (
|
10
|
+
var r = cb(), is_promise = r instanceof Promise;
|
11
|
+
if (is_promise)
|
12
12
|
promises.push(r.catch(set_error).finally(() => scope.end()));
|
13
13
|
return r;
|
14
14
|
}
|
@@ -17,7 +17,8 @@ const measure = (cb, scope, promises) => {
|
|
17
17
|
throw e;
|
18
18
|
}
|
19
19
|
finally {
|
20
|
-
|
20
|
+
if (is_promise !== true)
|
21
|
+
scope.end();
|
21
22
|
}
|
22
23
|
};
|
23
24
|
const create = (name, options) => {
|