@graphql-tools/utils
Advanced tools
Comparing version 10.5.5 to 10.5.6-alpha-20241113141809-caf6b82b08c54dee5ebe372ee73e76efc1d0f7d6
@@ -17,5 +17,9 @@ "use strict"; | ||
if (onEnd) { | ||
let onEndWithValueResult /** R in onEndWithValue */ = undefined; | ||
onEndWithValue = value => { | ||
if (onEndWithValueResult) { | ||
return onEndWithValueResult; | ||
} | ||
const onEnd$ = onEnd(); | ||
return (0, jsutils_js_1.isPromise)(onEnd$) ? onEnd$.then(() => value) : value; | ||
return (onEndWithValueResult = (0, jsutils_js_1.isPromise)(onEnd$) ? onEnd$.then(() => value) : value); | ||
}; | ||
@@ -38,5 +42,11 @@ } | ||
if (onError) { | ||
let onErrorResult = undefined; | ||
// Capture rejectCallback to ensure it cannot be null. | ||
const reject = onError; | ||
mapReject = (error) => asyncMapValue(error, reject).then(iteratorResult, abruptClose); | ||
mapReject = (error) => { | ||
if (onErrorResult) { | ||
return onErrorResult; | ||
} | ||
return (onErrorResult = asyncMapValue(error, reject).then(iteratorResult, abruptClose)); | ||
}; | ||
} | ||
@@ -43,0 +53,0 @@ return { |
@@ -14,5 +14,9 @@ import { isPromise } from './jsutils.js'; | ||
if (onEnd) { | ||
let onEndWithValueResult /** R in onEndWithValue */ = undefined; | ||
onEndWithValue = value => { | ||
if (onEndWithValueResult) { | ||
return onEndWithValueResult; | ||
} | ||
const onEnd$ = onEnd(); | ||
return isPromise(onEnd$) ? onEnd$.then(() => value) : value; | ||
return (onEndWithValueResult = isPromise(onEnd$) ? onEnd$.then(() => value) : value); | ||
}; | ||
@@ -35,5 +39,11 @@ } | ||
if (onError) { | ||
let onErrorResult = undefined; | ||
// Capture rejectCallback to ensure it cannot be null. | ||
const reject = onError; | ||
mapReject = (error) => asyncMapValue(error, reject).then(iteratorResult, abruptClose); | ||
mapReject = (error) => { | ||
if (onErrorResult) { | ||
return onErrorResult; | ||
} | ||
return (onErrorResult = asyncMapValue(error, reject).then(iteratorResult, abruptClose)); | ||
}; | ||
} | ||
@@ -40,0 +50,0 @@ return { |
{ | ||
"name": "@graphql-tools/utils", | ||
"version": "10.5.5", | ||
"version": "10.5.6-alpha-20241113141809-caf6b82b08c54dee5ebe372ee73e76efc1d0f7d6", | ||
"description": "Common package containing utils and types for GraphQL tools", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
508308
10950
2