@envelop/core
Advanced tools
Comparing version 5.0.2 to 5.0.3-alpha-20250113112407-248a4aac619ea24b764021f6a0a9efc97b113ed8
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.envelop = void 0; | ||
exports.envelop = envelop; | ||
const orchestrator_js_1 = require("./orchestrator.js"); | ||
@@ -28,2 +28,1 @@ function notEmpty(value) { | ||
} | ||
exports.envelop = envelop; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDocumentString = exports.documentStringMap = void 0; | ||
exports.documentStringMap = void 0; | ||
exports.getDocumentString = getDocumentString; | ||
exports.documentStringMap = new WeakMap(); | ||
@@ -13,2 +14,1 @@ function getDocumentString(document, print) { | ||
} | ||
exports.getDocumentString = getDocumentString; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createEnvelopOrchestrator = void 0; | ||
exports.createEnvelopOrchestrator = createEnvelopOrchestrator; | ||
const document_string_map_js_1 = require("./document-string-map.js"); | ||
@@ -20,2 +20,5 @@ const utils_js_1 = require("./utils.js"); | ||
const replaceSchema = (newSchema, ignorePluginIndex = -1) => { | ||
if (schema === newSchema) { | ||
return; | ||
} | ||
schema = newSchema; | ||
@@ -459,2 +462,1 @@ if (initDone) { | ||
} | ||
exports.createEnvelopOrchestrator = createEnvelopOrchestrator; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useMaskedErrors = exports.defaultMaskError = exports.createDefaultMaskError = exports.isOriginalGraphQLError = exports.isGraphQLError = exports.DEFAULT_ERROR_MESSAGE = void 0; | ||
exports.defaultMaskError = exports.createDefaultMaskError = exports.DEFAULT_ERROR_MESSAGE = void 0; | ||
exports.isGraphQLError = isGraphQLError; | ||
exports.isOriginalGraphQLError = isOriginalGraphQLError; | ||
exports.useMaskedErrors = useMaskedErrors; | ||
const utils_js_1 = require("../utils.js"); | ||
@@ -9,3 +12,2 @@ exports.DEFAULT_ERROR_MESSAGE = 'Unexpected error.'; | ||
} | ||
exports.isGraphQLError = isGraphQLError; | ||
function isOriginalGraphQLError(error) { | ||
@@ -20,3 +22,2 @@ if (isGraphQLError(error)) { | ||
} | ||
exports.isOriginalGraphQLError = isOriginalGraphQLError; | ||
function createSerializableGraphQLError(message, originalError, isDev) { | ||
@@ -88,2 +89,1 @@ const error = new Error(message); | ||
} | ||
exports.useMaskedErrors = useMaskedErrors; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mapMaybePromise = exports.isPromise = exports.errorAsyncIterator = exports.finalAsyncIterator = exports.handleStreamOrSingleExecutionResult = exports.isAsyncIterable = exports.makeExecute = exports.mapAsyncIterator = exports.makeSubscribe = exports.isIntrospectionOperationString = exports.envelopIsIntrospectionSymbol = void 0; | ||
exports.makeExecute = exports.makeSubscribe = exports.envelopIsIntrospectionSymbol = void 0; | ||
exports.isIntrospectionOperationString = isIntrospectionOperationString; | ||
exports.mapAsyncIterator = mapAsyncIterator; | ||
exports.isAsyncIterable = isAsyncIterable; | ||
exports.handleStreamOrSingleExecutionResult = handleStreamOrSingleExecutionResult; | ||
exports.finalAsyncIterator = finalAsyncIterator; | ||
exports.errorAsyncIterator = errorAsyncIterator; | ||
exports.isPromise = isPromise; | ||
exports.mapMaybePromise = mapMaybePromise; | ||
exports.envelopIsIntrospectionSymbol = Symbol('ENVELOP_IS_INTROSPECTION'); | ||
@@ -8,3 +16,2 @@ function isIntrospectionOperationString(operation) { | ||
} | ||
exports.isIntrospectionOperationString = isIntrospectionOperationString; | ||
function getSubscribeArgs(args) { | ||
@@ -41,2 +48,3 @@ return args.length === 1 | ||
await iterator.return?.(); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
} | ||
@@ -72,3 +80,2 @@ catch (_error) { | ||
} | ||
exports.mapAsyncIterator = mapAsyncIterator; | ||
function getExecuteArgs(args) { | ||
@@ -104,3 +111,2 @@ return args.length === 1 | ||
} | ||
exports.isAsyncIterable = isAsyncIterable; | ||
/** | ||
@@ -124,3 +130,2 @@ * A utility function for handling `onExecuteDone` hook result, for simplifying the handling of AsyncIterable returned from `execute`. | ||
} | ||
exports.handleStreamOrSingleExecutionResult = handleStreamOrSingleExecutionResult; | ||
function finalAsyncIterator(source, onFinal) { | ||
@@ -161,3 +166,2 @@ const iterator = source[Symbol.asyncIterator](); | ||
} | ||
exports.finalAsyncIterator = finalAsyncIterator; | ||
function errorAsyncIterator(source, onError) { | ||
@@ -194,7 +198,5 @@ const iterator = source[Symbol.asyncIterator](); | ||
} | ||
exports.errorAsyncIterator = errorAsyncIterator; | ||
function isPromise(value) { | ||
return value?.then !== undefined; | ||
} | ||
exports.isPromise = isPromise; | ||
function mapMaybePromise(value, mapper, errorMapper) { | ||
@@ -222,2 +224,1 @@ if (isPromise(value)) { | ||
} | ||
exports.mapMaybePromise = mapMaybePromise; |
@@ -17,2 +17,5 @@ import { documentStringMap } from './document-string-map.js'; | ||
const replaceSchema = (newSchema, ignorePluginIndex = -1) => { | ||
if (schema === newSchema) { | ||
return; | ||
} | ||
schema = newSchema; | ||
@@ -19,0 +22,0 @@ if (initDone) { |
@@ -35,2 +35,3 @@ export const envelopIsIntrospectionSymbol = Symbol('ENVELOP_IS_INTROSPECTION'); | ||
await iterator.return?.(); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
} | ||
@@ -37,0 +38,0 @@ catch (_error) { |
{ | ||
"name": "@envelop/core", | ||
"version": "5.0.2", | ||
"version": "5.0.3-alpha-20250113112407-248a4aac619ea24b764021f6a0a9efc97b113ed8", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -9,3 +9,3 @@ ## `@envelop/core` | ||
- [`useSchema`](./docs/use-schema.md) | ||
- [`useLazyLoadedSchema`](./docs/use-lazy-loaded-schema.md) | ||
- [`useSchemaByContext`](./docs/use-schema-by-context.md) | ||
- [`useErrorHandler`](./docs/use-error-handler.md) | ||
@@ -12,0 +12,0 @@ - [`useExtendContext`](./docs/use-extend-context.md) |
@@ -19,3 +19,3 @@ import { AsyncIterableIteratorOrValue, DefaultContext, ExecuteFunction, ExecutionArgs, OnExecuteDoneEventPayload, OnExecuteDoneHookResult, OnExecuteDoneHookResultOnNextHook, PromiseOrValue, SubscribeFunction } from '@envelop/types'; | ||
*/ | ||
export declare function isAsyncIterable<TType>(maybeAsyncIterable: unknown): maybeAsyncIterable is AsyncIterable<TType>; | ||
export declare function isAsyncIterable<TType>(maybeAsyncIterable: any): maybeAsyncIterable is AsyncIterable<TType>; | ||
/** | ||
@@ -22,0 +22,0 @@ * A utility function for handling `onExecuteDone` hook result, for simplifying the handling of AsyncIterable returned from `execute`. |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2130
91822
2