@envelop/core 2.4.0-alpha-0969daf.0 → 2.4.0-alpha-db79afa.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/index.js CHANGED
@@ -341,6 +341,10 @@ function getInMemoryLRUCache({ max = 1000, onDelete = () => { }, } = {}) {
341
341
  },
342
342
  };
343
343
  }
344
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
345
+ function isSourceObject(maybeSource) {
346
+ return maybeSource != null && maybeSource.body != null;
347
+ }
344
348
 
345
349
  function createEnvelopOrchestrator(plugins) {
346
350
  let schema = null;
@@ -787,8 +791,7 @@ function createEnvelopOrchestrator(plugins) {
787
791
  };
788
792
  }
789
793
 
790
- var _a;
791
- const getTimestamp = typeof globalThis !== 'undefined' && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.performance) === null || _a === void 0 ? void 0 : _a.now) ? () => performance.now() : () => Date.now();
794
+ const getTimestamp = typeof performance !== 'undefined' && performance.now ? () => performance.now() : () => Date.now();
792
795
  const measure = () => {
793
796
  const start = getTimestamp();
794
797
  return () => {
@@ -1339,6 +1342,7 @@ exports.isIntrospectionOperation = isIntrospectionOperation;
1339
1342
  exports.isIntrospectionOperationString = isIntrospectionOperationString;
1340
1343
  exports.isOperationDefinition = isOperationDefinition;
1341
1344
  exports.isPluginEnabled = isPluginEnabled;
1345
+ exports.isSourceObject = isSourceObject;
1342
1346
  exports.makeExecute = makeExecute;
1343
1347
  exports.makeSubscribe = makeSubscribe;
1344
1348
  exports.mapAsyncIterator = mapAsyncIterator;
package/index.mjs CHANGED
@@ -337,6 +337,10 @@ function getInMemoryLRUCache({ max = 1000, onDelete = () => { }, } = {}) {
337
337
  },
338
338
  };
339
339
  }
340
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
341
+ function isSourceObject(maybeSource) {
342
+ return maybeSource != null && maybeSource.body != null;
343
+ }
340
344
 
341
345
  function createEnvelopOrchestrator(plugins) {
342
346
  let schema = null;
@@ -783,8 +787,7 @@ function createEnvelopOrchestrator(plugins) {
783
787
  };
784
788
  }
785
789
 
786
- var _a;
787
- const getTimestamp = typeof globalThis !== 'undefined' && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.performance) === null || _a === void 0 ? void 0 : _a.now) ? () => performance.now() : () => Date.now();
790
+ const getTimestamp = typeof performance !== 'undefined' && performance.now ? () => performance.now() : () => Date.now();
788
791
  const measure = () => {
789
792
  const start = getTimestamp();
790
793
  return () => {
@@ -1311,4 +1314,4 @@ const useImmediateIntrospection = () => {
1311
1314
  };
1312
1315
  };
1313
1316
 
1314
- export { DEFAULT_ERROR_MESSAGE, EnvelopError, enableIf, envelop, envelopIsIntrospectionSymbol, errorAsyncIterator, finalAsyncIterator, formatError, getInMemoryLRUCache, handleStreamOrSingleExecutionResult, isAsyncIterable, isIntrospectionDocument, isIntrospectionOperation, isIntrospectionOperationString, isOperationDefinition, isPluginEnabled, makeExecute, makeSubscribe, mapAsyncIterator, useAsyncSchema, useEnvelop, useErrorHandler, useExtendContext, useImmediateIntrospection, useLazyLoadedSchema, useLogger, useMaskedErrors, usePayloadFormatter, useSchema, useTiming };
1317
+ export { DEFAULT_ERROR_MESSAGE, EnvelopError, enableIf, envelop, envelopIsIntrospectionSymbol, errorAsyncIterator, finalAsyncIterator, formatError, getInMemoryLRUCache, handleStreamOrSingleExecutionResult, isAsyncIterable, isIntrospectionDocument, isIntrospectionOperation, isIntrospectionOperationString, isOperationDefinition, isPluginEnabled, isSourceObject, makeExecute, makeSubscribe, mapAsyncIterator, useAsyncSchema, useEnvelop, useErrorHandler, useExtendContext, useImmediateIntrospection, useLazyLoadedSchema, useLogger, useMaskedErrors, usePayloadFormatter, useSchema, useTiming };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envelop/core",
3
- "version": "2.4.0-alpha-0969daf.0",
3
+ "version": "2.4.0-alpha-db79afa.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
package/utils.d.ts CHANGED
@@ -43,3 +43,4 @@ export declare function getInMemoryLRUCache<V>({ max, onDelete, }?: {
43
43
  }): BasicCache<V> & {
44
44
  clear(): void;
45
45
  };
46
+ export declare function isSourceObject(maybeSource: any): maybeSource is Source;