@apollo/client 3.8.0-alpha.1 → 3.8.0-alpha.11
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/README.md +3 -1
- package/apollo-client.cjs +661 -468
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +56 -44
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +56 -44
- package/cache/core/cache.d.ts +2 -1
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js +1 -0
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +3 -2
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +7 -7
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +1 -1
- package/cache/inmemory/helpers.d.ts +2 -2
- package/cache/inmemory/helpers.d.ts.map +1 -1
- package/cache/inmemory/helpers.js +2 -2
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +4 -2
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +2 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/object-canon.d.ts +0 -1
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +1 -1
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts +12 -12
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +15 -4
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +2 -2
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +1 -1
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +4 -4
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +10 -9
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +17 -11
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts +12 -7
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +71 -17
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +6 -7
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +6 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +1 -1
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +7 -7
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +24 -14
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +142 -83
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +142 -83
- package/core/index.js +2 -2
- package/core/index.js.map +1 -1
- package/core/networkStatus.d.ts +1 -0
- package/core/networkStatus.d.ts.map +1 -1
- package/core/networkStatus.js +3 -0
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +24 -17
- package/core/types.d.ts.map +1 -1
- package/core/types.js +1 -0
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +11 -12
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/errors/index.d.ts +2 -2
- package/errors/index.d.ts.map +1 -1
- package/invariantErrorCodes.js +58 -52
- package/link/batch/batch.cjs +5 -3
- package/link/batch/batch.cjs.map +1 -1
- package/link/batch/batch.cjs.native.js +5 -3
- package/link/batch/batching.d.ts +2 -2
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js +5 -3
- package/link/batch/batching.js.map +1 -1
- package/link/batch-http/batch-http.cjs +12 -2
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +12 -2
- package/link/batch-http/batchHttpLink.d.ts.map +1 -1
- package/link/batch-http/batchHttpLink.js +13 -3
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/context/index.d.ts +2 -1
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/core/types.d.ts +15 -15
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/createHttpLink.d.ts +0 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +10 -2
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +20 -38
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +20 -38
- package/link/http/iterators/async.js.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/iterators/promise.js.map +1 -1
- package/link/http/iterators/reader.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.js +1 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +3 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.d.ts.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -2
- package/link/persisted-queries/index.d.ts +2 -2
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/persisted-queries.cjs +3 -3
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
- package/link/utils/throwServerError.d.ts +1 -1
- package/link/utils/throwServerError.d.ts.map +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +2 -2
- package/package.json +26 -24
- package/react/cache/QuerySubscription.d.ts +26 -0
- package/react/cache/QuerySubscription.d.ts.map +1 -0
- package/react/cache/QuerySubscription.js +88 -0
- package/react/cache/QuerySubscription.js.map +1 -0
- package/react/cache/SuspenseCache.d.ts +9 -13
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.js +17 -40
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/components/Query.d.ts +2 -2
- package/react/components/Query.d.ts.map +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.d.ts +2 -2
- package/react/components/Subscription.d.ts.map +1 -1
- package/react/components/Subscription.js.map +1 -1
- package/react/components/types.d.ts +2 -2
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.js +2 -2
- package/react/context/ApolloProvider.js +2 -2
- package/react/context/context.cjs +4 -4
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +4 -4
- package/react/hoc/graphql.d.ts +2 -1
- package/react/hoc/graphql.d.ts.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +1 -1
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +2 -2
- package/react/hoc/hoc.cjs +4 -4
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +4 -4
- package/react/hoc/mutation-hoc.d.ts +2 -2
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.d.ts +1 -1
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.d.ts +1 -1
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.d.ts +6 -6
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.js +2 -2
- package/react/hooks/hooks.cjs +190 -174
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +190 -174
- package/react/hooks/internal/__use.d.ts +2 -0
- package/react/hooks/internal/__use.d.ts.map +1 -0
- package/react/hooks/internal/__use.js +13 -0
- package/react/hooks/internal/__use.js.map +1 -0
- package/react/hooks/internal/index.d.ts +3 -0
- package/react/hooks/internal/index.d.ts.map +1 -1
- package/react/hooks/internal/index.js +3 -0
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +3 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +2 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +1 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +11 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +1 -0
- package/react/hooks/useApolloClient.js +2 -2
- package/react/hooks/useFragment.d.ts +4 -2
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +9 -8
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +2 -2
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +22 -8
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +2 -2
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +9 -8
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +6 -5
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +21 -7
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -3
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +1 -2
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseCache.d.ts +2 -1
- package/react/hooks/useSuspenseCache.d.ts.map +1 -1
- package/react/hooks/useSuspenseCache.js +7 -5
- package/react/hooks/useSuspenseCache.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +16 -4
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +73 -136
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.d.ts +1 -1
- package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/parser/index.js +6 -6
- package/react/parser/parser.cjs +10 -10
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +10 -10
- package/react/react.cjs +112 -38
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +112 -38
- package/react/ssr/RenderPromises.d.ts +4 -4
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/getDataFromTree.d.ts +1 -1
- package/react/ssr/getDataFromTree.d.ts.map +1 -1
- package/react/types/types.d.ts +26 -25
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +30 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +30 -3
- package/testing/core/index.d.ts +2 -1
- package/testing/core/index.d.ts.map +1 -1
- package/testing/core/index.js +1 -0
- package/testing/core/index.js.map +1 -1
- package/testing/core/itAsync.js.map +1 -1
- package/testing/core/mocking/mockFetch.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +8 -4
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +14 -4
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
- package/testing/core/mocking/mockQueryManager.js +3 -3
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js +4 -5
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +2 -2
- package/testing/core/observableToPromise.d.ts.map +1 -1
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/core/wait.d.ts +3 -0
- package/testing/core/wait.d.ts.map +1 -0
- package/testing/core/wait.js +16 -0
- package/testing/core/wait.js.map +1 -0
- package/testing/react/MockedProvider.d.ts +1 -0
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +2 -2
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +112 -40
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +112 -40
- package/utilities/common/arrays.d.ts +1 -0
- package/utilities/common/arrays.d.ts.map +1 -1
- package/utilities/common/arrays.js +1 -0
- package/utilities/common/arrays.js.map +1 -1
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +2 -2
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.d.ts +4 -4
- package/utilities/common/incrementalResult.d.ts.map +1 -1
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +0 -1
- package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +1 -1
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.d.ts +2 -2
- package/utilities/common/mergeDeep.d.ts.map +1 -1
- package/utilities/common/mergeOptions.d.ts +3 -3
- package/utilities/common/mergeOptions.d.ts.map +1 -1
- package/utilities/common/mergeOptions.js +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/globals/DEV.d.ts +1 -1
- package/utilities/globals/DEV.d.ts.map +1 -1
- package/utilities/globals/DEV.js +1 -17
- package/utilities/globals/DEV.js.map +1 -1
- package/utilities/globals/global.d.ts +5 -2
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +5 -22
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +5 -22
- package/utilities/globals/index.d.ts +1 -1
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +1 -4
- package/utilities/globals/index.js.map +1 -1
- package/utilities/graphql/directives.d.ts +2 -2
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +5 -5
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +4 -4
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +16 -12
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/storeUtils.d.ts +3 -3
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +2 -2
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +9 -9
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +168 -91
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +2 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +2 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts +5 -5
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/Concast.js +2 -2
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/policies/pagination.d.ts +7 -7
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/promises/decoration.d.ts +15 -0
- package/utilities/promises/decoration.d.ts.map +1 -0
- package/utilities/promises/decoration.js +25 -0
- package/utilities/promises/decoration.js.map +1 -0
- package/utilities/types/IsStrictlyAny.d.ts +3 -3
- package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
- package/utilities/utilities.cjs +256 -128
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +256 -128
- package/version.js +1 -1
- package/cache/inmemory/__mocks__/optimism.d.ts +0 -2
- package/cache/inmemory/__mocks__/optimism.d.ts.map +0 -1
- package/cache/inmemory/__mocks__/optimism.js +0 -14
- package/cache/inmemory/__mocks__/optimism.js.map +0 -1
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('../utilities/globals');
|
|
5
|
+
var globals = require('../utilities/globals');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var core$1 = require('../core');
|
|
9
9
|
var cache = require('../cache');
|
|
10
10
|
var context = require('../react/context');
|
|
11
11
|
var core = require('./core');
|
|
12
|
+
var trie = require('@wry/trie');
|
|
13
|
+
var utilities = require('../utilities');
|
|
14
|
+
var optimism = require('optimism');
|
|
12
15
|
|
|
13
16
|
function _interopNamespace(e) {
|
|
14
17
|
if (e && e.__esModule) return e;
|
|
@@ -24,49 +27,118 @@ function _interopNamespace(e) {
|
|
|
24
27
|
|
|
25
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
29
|
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
var NetworkStatus;
|
|
31
|
+
(function (NetworkStatus) {
|
|
32
|
+
NetworkStatus[NetworkStatus["loading"] = 1] = "loading";
|
|
33
|
+
NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables";
|
|
34
|
+
NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore";
|
|
35
|
+
NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch";
|
|
36
|
+
NetworkStatus[NetworkStatus["poll"] = 6] = "poll";
|
|
37
|
+
NetworkStatus[NetworkStatus["ready"] = 7] = "ready";
|
|
38
|
+
NetworkStatus[NetworkStatus["error"] = 8] = "error";
|
|
39
|
+
})(NetworkStatus || (NetworkStatus = {}));
|
|
40
|
+
function isNetworkRequestSettled(networkStatus) {
|
|
41
|
+
return networkStatus === 7 || networkStatus === 8;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function wrapWithCustomPromise(concast) {
|
|
45
|
+
return new Promise(function (resolve, reject) {
|
|
46
|
+
var subscription = concast.subscribe({
|
|
47
|
+
next: function (value) {
|
|
48
|
+
resolve(value);
|
|
49
|
+
subscription.unsubscribe();
|
|
50
|
+
},
|
|
51
|
+
error: reject,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var isMultipartQuery = optimism.wrap(function (query) {
|
|
56
|
+
return utilities.hasAnyDirectives(['defer', 'stream'], query);
|
|
57
|
+
});
|
|
58
|
+
var QuerySubscription = (function () {
|
|
59
|
+
function QuerySubscription(observable, options) {
|
|
60
|
+
if (options === void 0) { options = Object.create(null); }
|
|
61
|
+
var _a;
|
|
62
|
+
this.listeners = new Set();
|
|
63
|
+
this.listen = this.listen.bind(this);
|
|
64
|
+
this.handleNext = this.handleNext.bind(this);
|
|
65
|
+
this.handleError = this.handleError.bind(this);
|
|
66
|
+
this.dispose = this.dispose.bind(this);
|
|
67
|
+
this.observable = observable;
|
|
68
|
+
this.result = observable.getCurrentResult();
|
|
69
|
+
if (options.onDispose) {
|
|
70
|
+
this.onDispose = options.onDispose;
|
|
71
|
+
}
|
|
72
|
+
this.subscription = observable.subscribe({
|
|
73
|
+
next: this.handleNext,
|
|
74
|
+
error: this.handleError,
|
|
75
|
+
});
|
|
76
|
+
globals.__DEV__ ? globals.invariant(observable['concast'], 'Unexpected error: A concast was not found on the observable.') : globals.invariant(observable['concast'], 28);
|
|
77
|
+
var concast = observable['concast'];
|
|
78
|
+
this.promise = isMultipartQuery(observable.query)
|
|
79
|
+
? wrapWithCustomPromise(concast)
|
|
80
|
+
: concast.promise;
|
|
81
|
+
this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
|
|
30
82
|
}
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fulfilled: false,
|
|
38
|
-
promise: promise
|
|
39
|
-
.catch(function () {
|
|
40
|
-
})
|
|
41
|
-
.finally(function () {
|
|
42
|
-
entry.fulfilled = true;
|
|
43
|
-
}),
|
|
83
|
+
QuerySubscription.prototype.listen = function (listener) {
|
|
84
|
+
var _this = this;
|
|
85
|
+
clearTimeout(this.autoDisposeTimeoutId);
|
|
86
|
+
this.listeners.add(listener);
|
|
87
|
+
return function () {
|
|
88
|
+
_this.listeners.delete(listener);
|
|
44
89
|
};
|
|
45
|
-
map.set(variablesKey, entry);
|
|
46
|
-
this.queries.set(query, map);
|
|
47
|
-
return entry;
|
|
48
90
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
.get(query)) === null || _a === void 0 ? void 0 : _a.get(this.getVariablesKey(variables));
|
|
91
|
+
QuerySubscription.prototype.refetch = function (variables) {
|
|
92
|
+
this.promise = this.observable.refetch(variables);
|
|
93
|
+
return this.promise;
|
|
53
94
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
95
|
+
QuerySubscription.prototype.fetchMore = function (options) {
|
|
96
|
+
this.promise = this.observable.fetchMore(options);
|
|
97
|
+
return this.promise;
|
|
98
|
+
};
|
|
99
|
+
QuerySubscription.prototype.dispose = function () {
|
|
100
|
+
this.subscription.unsubscribe();
|
|
101
|
+
this.onDispose();
|
|
102
|
+
};
|
|
103
|
+
QuerySubscription.prototype.onDispose = function () {
|
|
104
|
+
};
|
|
105
|
+
QuerySubscription.prototype.handleNext = function (result) {
|
|
106
|
+
if (isNetworkRequestSettled(result.networkStatus) &&
|
|
107
|
+
this.result.data &&
|
|
108
|
+
result.data === void 0) {
|
|
109
|
+
result.data = this.result.data;
|
|
66
110
|
}
|
|
111
|
+
this.result = result;
|
|
112
|
+
this.deliver(result);
|
|
113
|
+
};
|
|
114
|
+
QuerySubscription.prototype.handleError = function (error) {
|
|
115
|
+
var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: core$1.NetworkStatus.error });
|
|
116
|
+
this.result = result;
|
|
117
|
+
this.deliver(result);
|
|
118
|
+
};
|
|
119
|
+
QuerySubscription.prototype.deliver = function (result) {
|
|
120
|
+
this.listeners.forEach(function (listener) { return listener(result); });
|
|
67
121
|
};
|
|
68
|
-
|
|
69
|
-
|
|
122
|
+
return QuerySubscription;
|
|
123
|
+
}());
|
|
124
|
+
|
|
125
|
+
var SuspenseCache = (function () {
|
|
126
|
+
function SuspenseCache(options) {
|
|
127
|
+
if (options === void 0) { options = Object.create(null); }
|
|
128
|
+
this.cacheKeys = new trie.Trie(utilities.canUseWeakMap, function (cacheKey) { return cacheKey; });
|
|
129
|
+
this.subscriptions = new Map();
|
|
130
|
+
this.options = options;
|
|
131
|
+
}
|
|
132
|
+
SuspenseCache.prototype.getSubscription = function (client, query, variables, createObservable) {
|
|
133
|
+
var _this = this;
|
|
134
|
+
var cacheKey = this.cacheKeys.lookup(client, query, cache.canonicalStringify(variables));
|
|
135
|
+
if (!this.subscriptions.has(cacheKey)) {
|
|
136
|
+
this.subscriptions.set(cacheKey, new QuerySubscription(createObservable(), {
|
|
137
|
+
autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,
|
|
138
|
+
onDispose: function () { return _this.subscriptions.delete(cacheKey); },
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
return this.subscriptions.get(cacheKey);
|
|
70
142
|
};
|
|
71
143
|
return SuspenseCache;
|
|
72
144
|
}());
|
|
@@ -75,11 +147,11 @@ var MockedProvider = (function (_super) {
|
|
|
75
147
|
tslib.__extends(MockedProvider, _super);
|
|
76
148
|
function MockedProvider(props) {
|
|
77
149
|
var _this = _super.call(this, props) || this;
|
|
78
|
-
var _a = _this.props, mocks = _a.mocks, addTypename = _a.addTypename, defaultOptions = _a.defaultOptions, cache$1 = _a.cache, resolvers = _a.resolvers, link = _a.link, suspenseCache = _a.suspenseCache;
|
|
150
|
+
var _a = _this.props, mocks = _a.mocks, addTypename = _a.addTypename, defaultOptions = _a.defaultOptions, cache$1 = _a.cache, resolvers = _a.resolvers, link = _a.link, suspenseCache = _a.suspenseCache, showWarnings = _a.showWarnings;
|
|
79
151
|
var client = new core$1.ApolloClient({
|
|
80
152
|
cache: cache$1 || new cache.InMemoryCache({ addTypename: addTypename }),
|
|
81
153
|
defaultOptions: defaultOptions,
|
|
82
|
-
link: link || new core.MockLink(mocks || [], addTypename),
|
|
154
|
+
link: link || new core.MockLink(mocks || [], addTypename, { showWarnings: showWarnings }),
|
|
83
155
|
resolvers: resolvers,
|
|
84
156
|
});
|
|
85
157
|
_this.state = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,GAAG,EAAE,GAAG,SAAS,GAAG,EAAkB,CAAC;AAE9E,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAE1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,IAAM,OAAO,GAA4C,KAAK,CAAC,OAAO,CAAC;AAE9E,MAAM,UAAU,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// A version of Array.isArray that works better with readonly arrays.\nexport const isArray: (a: any) => a is any[] | readonly any[] = Array.isArray;\n\nexport function isNonEmptyArray<T>(value?: ArrayLike<T>): value is Array<T> {\n return Array.isArray(value) && value.length > 0;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloneDeep.js","sourceRoot":"","sources":["../../../src/utilities/common/cloneDeep.ts"],"names":[],"mappings":"AAAQ,IAAA,QAAQ,GAAK,MAAM,CAAC,SAAS,SAArB,CAAsB;AAKtC,MAAM,UAAU,SAAS,CAAI,KAAQ;IACnC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAI,GAAM,EAAE,IAAoB;IACtD,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,KAAK,gBAAgB,CAAC,CAAC;YACrB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,IAAM,MAAI,GAAe,GAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAI,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;gBAC7B,MAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED,KAAK,iBAAiB,CAAC,CAAC;YACtB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAGxC,IAAM,MAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cloneDeep.js","sourceRoot":"","sources":["../../../src/utilities/common/cloneDeep.ts"],"names":[],"mappings":"AAAQ,IAAA,QAAQ,GAAK,MAAM,CAAC,SAAS,SAArB,CAAsB;AAKtC,MAAM,UAAU,SAAS,CAAI,KAAQ;IACnC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAI,GAAM,EAAE,IAAoB;IACtD,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,KAAK,gBAAgB,CAAC,CAAC;YACrB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,IAAM,MAAI,GAAe,GAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAI,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;gBAC7B,MAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED,KAAK,iBAAiB,CAAC,CAAC;YACtB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAGxC,IAAM,MAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAA8B,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;gBACrD,MAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAE,GAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED;YACE,OAAO,GAAG,CAAC;KACZ;AACH,CAAC","sourcesContent":["const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep<T>(value: T): T {\n return cloneDeepHelper(value);\n}\n\nfunction cloneDeepHelper<T>(val: T, seen?: Map<any, any>): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val as T & Record<string, any>).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FetchResult } from "../../link/core";
|
|
2
|
-
export declare function graphQLResultHasError(result: FetchResult): boolean;
|
|
3
|
-
export declare function getGraphQLErrorsFromResult(result: FetchResult): import("graphql").GraphQLError[];
|
|
2
|
+
export declare function graphQLResultHasError<T>(result: FetchResult<T>): boolean;
|
|
3
|
+
export declare function getGraphQLErrorsFromResult<T>(result: FetchResult<T>): import("graphql").GraphQLError[];
|
|
4
4
|
//# sourceMappingURL=errorHandling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAGxE;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,oCAgBnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,0CAA0C,CAAC;AAE7F,MAAM,UAAU,qBAAqB,
|
|
1
|
+
{"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,0CAA0C,CAAC;AAE7F,MAAM,UAAU,qBAAqB,CAAI,MAAsB;IAC7D,IAAM,MAAM,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAI,MAAsB;IAClE,IAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;QAClD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC,EAAE,CAAC;IAEP,IACE,iCAAiC,CAAC,MAAM,CAAC;QACzC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EACnC;QACA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,iBAAiB;YAC3C,IAAI,iBAAiB,CAAC,MAAM,EAAE;gBAC5B,aAAa,CAAC,IAAI,OAAlB,aAAa,EAAS,iBAAiB,CAAC,MAAM,EAAE;aACjD;QACH,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import { FetchResult } from \"../../link/core\";\nimport { isNonEmptyArray } from \"../../utilities/common/arrays\";\nimport { isExecutionPatchIncrementalResult } from \"../../utilities/common/incrementalResult\";\n\nexport function graphQLResultHasError<T>(result: FetchResult<T>): boolean {\n const errors = getGraphQLErrorsFromResult(result);\n return isNonEmptyArray(errors);\n}\n\nexport function getGraphQLErrorsFromResult<T>(result: FetchResult<T>) {\n const graphQLErrors = isNonEmptyArray(result.errors)\n ? result.errors.slice(0)\n : [];\n\n if (\n isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)\n ) {\n result.incremental.forEach((incrementalResult) => {\n if (incrementalResult.errors) {\n graphQLErrors.push(...incrementalResult.errors);\n }\n });\n }\n return graphQLErrors;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecutionPatchIncrementalResult, ExecutionPatchInitialResult, ExecutionPatchResult, FetchResult } from "../../link/core";
|
|
2
|
-
export declare function isExecutionPatchIncrementalResult(value: FetchResult): value is ExecutionPatchIncrementalResult;
|
|
3
|
-
export declare function isExecutionPatchInitialResult(value: FetchResult): value is ExecutionPatchInitialResult
|
|
4
|
-
export declare function isExecutionPatchResult(value: FetchResult): value is ExecutionPatchResult
|
|
5
|
-
export declare function mergeIncrementalData<TData>(prevResult: TData, result: ExecutionPatchResult<TData>): TData;
|
|
2
|
+
export declare function isExecutionPatchIncrementalResult<T>(value: FetchResult<T>): value is ExecutionPatchIncrementalResult;
|
|
3
|
+
export declare function isExecutionPatchInitialResult<T>(value: FetchResult<T>): value is ExecutionPatchInitialResult<T>;
|
|
4
|
+
export declare function isExecutionPatchResult<T>(value: FetchResult<T>): value is ExecutionPatchResult<T>;
|
|
5
|
+
export declare function mergeIncrementalData<TData extends object>(prevResult: TData, result: ExecutionPatchResult<TData>): TData;
|
|
6
6
|
//# sourceMappingURL=incrementalResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incrementalResult.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB,wBAAgB,iCAAiC,
|
|
1
|
+
{"version":3,"file":"incrementalResult.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB,wBAAgB,iCAAiC,CAAC,CAAC,EACjD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,KAAK,IAAI,+BAA+B,CAE1C;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,KAAK,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAEzC;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,KAAK,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAKlC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,SAAS,MAAM,EACvD,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,SAoBpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incrementalResult.js","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,UAAU,iCAAiC,CAC/C,
|
|
1
|
+
{"version":3,"file":"incrementalResult.js","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,UAAU,iCAAiC,CAC/C,KAAqB;IAErB,OAAO,aAAa,IAAI,KAAK,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAqB;IAErB,OAAO,SAAS,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAqB;IAErB,OAAO,CACL,iCAAiC,CAAC,KAAK,CAAC;QACxC,6BAA6B,CAAC,KAAK,CAAC,CACrC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,UAAiB,EACjB,MAAmC;IAEnC,IAAI,UAAU,GAAG,UAAU,CAAC;IAC5B,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,IACE,iCAAiC,CAAC,MAAM,CAAC;QACzC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EACnC;QACA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,EAAc;gBAAZ,IAAI,UAAA,EAAE,IAAI,UAAA;YACtC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;gBACzC,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,IAAM,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;gBAClC,IAAM,QAAM,GAAiC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpE,QAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBACnB,IAAI,GAAG,QAAqB,CAAC;aAC9B;YACD,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,UAAmB,CAAC;AAC7B,CAAC","sourcesContent":["import {\n ExecutionPatchIncrementalResult,\n ExecutionPatchInitialResult,\n ExecutionPatchResult,\n FetchResult,\n} from \"../../link/core\";\nimport { isNonEmptyArray } from \"./arrays\";\nimport { DeepMerger } from \"./mergeDeep\";\n\nexport function isExecutionPatchIncrementalResult<T>(\n value: FetchResult<T>\n): value is ExecutionPatchIncrementalResult {\n return \"incremental\" in value;\n}\n\nexport function isExecutionPatchInitialResult<T>(\n value: FetchResult<T>\n): value is ExecutionPatchInitialResult<T> {\n return \"hasNext\" in value && \"data\" in value;\n}\n\nexport function isExecutionPatchResult<T>(\n value: FetchResult<T>\n): value is ExecutionPatchResult<T> {\n return (\n isExecutionPatchIncrementalResult(value) ||\n isExecutionPatchInitialResult(value)\n );\n}\n\nexport function mergeIncrementalData<TData extends object>(\n prevResult: TData,\n result: ExecutionPatchResult<TData>\n) {\n let mergedData = prevResult;\n const merger = new DeepMerger();\n if (\n isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)\n ) {\n result.incremental.forEach(({ data, path }) => {\n for (let i = path.length - 1; i >= 0; --i) {\n const key = path[i];\n const isNumericKey = !isNaN(+key);\n const parent: Record<string | number, any> = isNumericKey ? [] : {};\n parent[key] = data;\n data = parent as typeof data;\n }\n mergedData = merger.merge(mergedData, data);\n });\n }\n return mergedData as TData;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybeDeepFreeze.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"maybeDeepFreeze.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AA8BA,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAK5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybeDeepFreeze.js","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"maybeDeepFreeze.js","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,SAAS,UAAU,CAAC,KAAU;IAC5B,IAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,UAAA,GAAG;QACjB,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YACtD,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;gBAC1C,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAmB,GAAM;IAC7C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpC,IAAI;YACF,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACpB;QAAC,OAAO,CAAC,EAAE;YAIV,IAAI,CAAC,YAAY,SAAS;gBAAE,OAAO,IAAI,CAAC;YACxC,MAAM,CAAC,CAAC;SACT;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,eAAe,CAAI,GAAM;IACvC,IAAI,OAAO,EAAE;QACX,UAAU,CAAC,GAAG,CAAC,CAAC;KACjB;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { __DEV__ } from '../globals';\nimport { isNonNullObject } from './objects';\n\nfunction deepFreeze(value: any) {\n const workSet = new Set([value]);\n workSet.forEach(obj => {\n if (isNonNullObject(obj) && shallowFreeze(obj) === obj) {\n Object.getOwnPropertyNames(obj).forEach(name => {\n if (isNonNullObject(obj[name])) workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\n\nfunction shallowFreeze<T extends object>(obj: T): T | null {\n if (__DEV__ && !Object.isFrozen(obj)) {\n try {\n Object.freeze(obj);\n } catch (e) {\n // Some types like Uint8Array and Node.js's Buffer cannot be frozen, but\n // they all throw a TypeError when you try, so we re-throw any exceptions\n // that are not TypeErrors, since that would be unexpected.\n if (e instanceof TypeError) return null;\n throw e;\n }\n }\n return obj;\n}\n\nexport function maybeDeepFreeze<T>(obj: T): T {\n if (__DEV__) {\n deepFreeze(obj);\n }\n return obj;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isNonNullObject } from "./objects";
|
|
2
|
-
export
|
|
2
|
+
export type TupleToIntersection<T extends any[]> = T extends [infer A] ? A : T extends [infer A, infer B] ? A & B : T extends [infer A, infer B, infer C] ? A & B & C : T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : T extends (infer U)[] ? U : any;
|
|
3
3
|
export declare function mergeDeep<T extends any[]>(...sources: T): TupleToIntersection<T>;
|
|
4
4
|
export declare function mergeDeepArray<T>(sources: T[]): T;
|
|
5
|
-
export
|
|
5
|
+
export type ReconcilerFunction<TContextArgs extends any[]> = (this: DeepMerger<TContextArgs>, target: Record<string | number, any>, source: Record<string | number, any>, property: string | number, ...context: TContextArgs) => any;
|
|
6
6
|
export declare class DeepMerger<TContextArgs extends any[]> {
|
|
7
7
|
private reconciler;
|
|
8
8
|
constructor(reconciler?: ReconcilerFunction<TContextArgs>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeDeep.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeDeep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAkB5C,
|
|
1
|
+
{"version":3,"file":"mergeDeep.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeDeep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAkB5C,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,GAAG,EAAE,IAC7C,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GACvB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GACpC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GACjD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC3E,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AAElC,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,EACvC,GAAG,OAAO,EAAE,CAAC,GACZ,mBAAmB,CAAC,CAAC,CAAC,CAExB;AAQD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAUjD;AAED,MAAM,MAAM,kBAAkB,CAAC,YAAY,SAAS,GAAG,EAAE,IAAI,CAC3D,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACpC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACpC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,GAAG,OAAO,EAAE,YAAY,KACrB,GAAG,CAAC;AAOT,qBAAa,UAAU,CAAC,YAAY,SAAS,GAAG,EAAE;IAE9C,OAAO,CAAC,UAAU;gBAAV,UAAU,GAAE,kBAAkB,CAAC,YAAY,CAAqB;IAGnE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,YAAY,GAAG,GAAG;IA6B9D,QAAQ,yBAAmB;IAElC,OAAO,CAAC,UAAU,CAAkB;IAE7B,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;CAgB3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QueryOptions, WatchQueryOptions, MutationOptions } from "../../core";
|
|
2
|
-
|
|
3
|
-
export declare function mergeOptions<TOptions extends OptionsUnion<any, any, any
|
|
1
|
+
import type { QueryOptions, WatchQueryOptions, MutationOptions, OperationVariables } from "../../core";
|
|
2
|
+
type OptionsUnion<TData, TVariables extends OperationVariables, TContext> = WatchQueryOptions<TVariables, TData> | QueryOptions<TVariables, TData> | MutationOptions<TData, TVariables, TContext>;
|
|
3
|
+
export declare function mergeOptions<TOptions extends Partial<OptionsUnion<any, any, any>>>(defaults: TOptions | Partial<TOptions> | undefined, options: TOptions | Partial<TOptions>): TOptions;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=mergeOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeOptions.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,
|
|
1
|
+
{"version":3,"file":"mergeOptions.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAIpB,KAAK,YAAY,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB,EAAE,QAAQ,IACpE,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,GACpC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,GAC/B,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEjD,wBAAgB,YAAY,CAC1B,QAAQ,SAAS,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAErD,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,EAClD,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GACpC,QAAQ,CAOV"}
|
|
@@ -2,7 +2,7 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import { compact } from "./compact.js";
|
|
3
3
|
export function mergeOptions(defaults, options) {
|
|
4
4
|
return compact(defaults, options, options.variables && {
|
|
5
|
-
variables: __assign(__assign({}, (defaults && defaults.variables)), options.variables),
|
|
5
|
+
variables: compact(__assign(__assign({}, (defaults && defaults.variables)), options.variables)),
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=mergeOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeOptions.js","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"mergeOptions.js","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,MAAM,UAAU,YAAY,CAG1B,QAAkD,EAClD,OAAqC;IAErC,OAAO,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI;QACrD,SAAS,EAAE,OAAO,uBACb,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,SAAS,EACpB;KACH,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n QueryOptions,\n WatchQueryOptions,\n MutationOptions,\n OperationVariables,\n} from \"../../core\";\n\nimport { compact } from \"./compact\";\n\ntype OptionsUnion<TData, TVariables extends OperationVariables, TContext> =\n | WatchQueryOptions<TVariables, TData>\n | QueryOptions<TVariables, TData>\n | MutationOptions<TData, TVariables, TContext>;\n\nexport function mergeOptions<\n TOptions extends Partial<OptionsUnion<any, any, any>>\n>(\n defaults: TOptions | Partial<TOptions> | undefined,\n options: TOptions | Partial<TOptions>,\n): TOptions {\n return compact(defaults, options, options.variables && {\n variables: compact({\n ...(defaults && defaults.variables),\n ...options.variables,\n }),\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DEV.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DEV.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":";AAGA,wBAgBE"}
|
package/utilities/globals/DEV.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import global from "./global.js";
|
|
2
2
|
import { maybe } from "./maybe.js";
|
|
3
|
-
|
|
4
|
-
var GLOBAL_KEY = [__, __].join("DEV");
|
|
5
|
-
function getDEV() {
|
|
6
|
-
try {
|
|
7
|
-
return Boolean(__DEV__);
|
|
8
|
-
}
|
|
9
|
-
catch (_a) {
|
|
10
|
-
Object.defineProperty(global, GLOBAL_KEY, {
|
|
11
|
-
value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
|
|
12
|
-
enumerable: false,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
});
|
|
16
|
-
return global[GLOBAL_KEY];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export default getDEV();
|
|
3
|
+
export default ("__DEV__" in global ? Boolean(global.__DEV__) : maybe(function () { return process.env.NODE_ENV; }) !== "production");
|
|
20
4
|
//# sourceMappingURL=DEV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DEV.js","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DEV.js","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,eAAe,CACb,SAAS,IAAI,MAAM;IAKjB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IASzB,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,EAApB,CAAoB,CAAC,KAAK,YAAY,CACvD,CAAC","sourcesContent":["import global from \"./global\";\nimport { maybe } from \"./maybe\";\n\nexport default (\n \"__DEV__\" in global\n // We want it to be possible to set __DEV__ globally to control the result\n // of this code, so it's important to check global.__DEV__ instead of\n // assuming a naked reference like __DEV__ refers to global scope, since\n // those references could be replaced with true or false by minifiers.\n ? Boolean(global.__DEV__)\n\n // In a buildless browser environment, maybe(() => process.env.NODE_ENV)\n // evaluates to undefined, so __DEV__ becomes true by default, but can be\n // initialized to false instead by a script/module that runs earlier.\n //\n // If you use tooling to replace process.env.NODE_ENV with a string like\n // \"development\", this code will become something like maybe(() =>\n // \"development\") !== \"production\", which also works as expected.\n : maybe(() => process.env.NODE_ENV) !== \"production\"\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":";;;AAEA,wBAcE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,eAAe,CACb,KAAK,CAAC,cAAM,OAAA,UAAU,EAAV,CAAU,CAAC;IACvB,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;IACnB,KAAK,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;IACjB,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;IAOnB,KAAK,CAAC,cAAa,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAA,CAAC,CAAC,CAAC,CAGhE,CAAC","sourcesContent":["import { maybe } from \"./maybe\";\n\nexport default (\n maybe(() => globalThis) ||\n maybe(() => window) ||\n maybe(() => self) ||\n maybe(() => global) ||\n // We don't expect the Function constructor ever to be invoked at runtime, as\n // long as at least one of globalThis, window, self, or global is defined, so\n // we are under no obligation to make it easy for static analysis tools to\n // detect syntactic usage of the Function constructor. If you think you can\n // improve your static analysis to detect this obfuscation, think again. This\n // is an arms race you cannot win, at least not in JavaScript.\n maybe(function() { return maybe.constructor(\"return this\")() })\n) as typeof globalThis & {\n __DEV__?: boolean;\n};\n"]}
|
|
@@ -19,38 +19,21 @@ var global$1 = (maybe(function () { return globalThis; }) ||
|
|
|
19
19
|
maybe(function () { return global; }) ||
|
|
20
20
|
maybe(function () { return maybe.constructor("return this")(); }));
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
try {
|
|
26
|
-
return Boolean(__DEV__);
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
Object.defineProperty(global$1, GLOBAL_KEY, {
|
|
30
|
-
value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
|
|
31
|
-
enumerable: false,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true,
|
|
34
|
-
});
|
|
35
|
-
return global$1[GLOBAL_KEY];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
var DEV = getDEV();
|
|
22
|
+
var DEV = ("__DEV__" in global$1
|
|
23
|
+
? Boolean(global$1.__DEV__)
|
|
24
|
+
: maybe(function () { return process.env.NODE_ENV; }) !== "production");
|
|
39
25
|
|
|
40
26
|
function removeTemporaryGlobals() {
|
|
41
27
|
return typeof graphql.Source === "function" ? process$1.remove() : process$1.remove();
|
|
42
28
|
}
|
|
43
29
|
|
|
44
|
-
|
|
45
|
-
__DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 40);
|
|
46
|
-
}
|
|
30
|
+
var __DEV__ = DEV;
|
|
47
31
|
removeTemporaryGlobals();
|
|
48
|
-
checkDEV();
|
|
49
32
|
|
|
50
33
|
exports.InvariantError = tsInvariant.InvariantError;
|
|
51
34
|
exports.invariant = tsInvariant.invariant;
|
|
52
35
|
exports.DEV = DEV;
|
|
53
|
-
exports.
|
|
36
|
+
exports.__DEV__ = __DEV__;
|
|
54
37
|
exports.global = global$1;
|
|
55
38
|
exports.maybe = maybe;
|
|
56
39
|
//# sourceMappingURL=globals.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.cjs","sources":["maybe.js","global.js","DEV.js","fix-graphql.js","index.js"],"sourcesContent":["export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) ||\n maybe(function () { return maybe.constructor(\"return this\")(); }));\n//# sourceMappingURL=global.js.map","import global from \"./global\";\nimport { maybe } from \"./maybe\";\
|
|
1
|
+
{"version":3,"file":"globals.cjs","sources":["maybe.js","global.js","DEV.js","fix-graphql.js","index.js"],"sourcesContent":["export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) ||\n maybe(function () { return maybe.constructor(\"return this\")(); }));\n//# sourceMappingURL=global.js.map","import global from \"./global\";\nimport { maybe } from \"./maybe\";\nexport default (\"__DEV__\" in global\n ? Boolean(global.__DEV__)\n : maybe(function () { return process.env.NODE_ENV; }) !== \"production\");\n//# sourceMappingURL=DEV.js.map","import { remove } from 'ts-invariant/process';\nimport { Source } from 'graphql';\nexport function removeTemporaryGlobals() {\n return typeof Source === \"function\" ? remove() : remove();\n}\n//# sourceMappingURL=fix-graphql.js.map","import { invariant, InvariantError } from \"ts-invariant\";\nimport DEV from \"./DEV\";\nexport { DEV };\nexport var __DEV__ = DEV;\nimport { removeTemporaryGlobals } from \"./fix-graphql\";\nremoveTemporaryGlobals();\nexport { maybe } from \"./maybe\";\nexport { default as global } from \"./global\";\nexport { invariant, InvariantError };\n//# sourceMappingURL=index.js.map"],"names":["global","Source","remove"],"mappings":";;;;;;;;AAAO,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI;AACR,QAAQ,OAAO,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,EAAE,EAAE,GAAG;AAClB;;ACJA,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,UAAU,CAAC,EAAE,CAAC;AACzD,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC;;ACHrE,UAAe,CAAC,SAAS,IAAIA,QAAM;AACnC,MAAM,OAAO,CAACA,QAAM,CAAC,OAAO,CAAC;AAC7B,MAAM,KAAK,CAAC,YAAY,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,YAAY;;ACFnE,SAAS,sBAAsB,GAAG;AACzC,IAAI,OAAO,OAAOC,cAAM,KAAK,UAAU,GAAGC,gBAAM,EAAE,GAAGA,gBAAM,EAAE,CAAC;AAC9D;;ACDU,IAAC,OAAO,GAAG,IAAI;AAEzB,sBAAsB,EAAE;;;;;;;;;"}
|
|
@@ -19,38 +19,21 @@ var global$1 = (maybe(function () { return globalThis; }) ||
|
|
|
19
19
|
maybe(function () { return global; }) ||
|
|
20
20
|
maybe(function () { return maybe.constructor("return this")(); }));
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
try {
|
|
26
|
-
return Boolean(__DEV__);
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
Object.defineProperty(global$1, GLOBAL_KEY, {
|
|
30
|
-
value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
|
|
31
|
-
enumerable: false,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true,
|
|
34
|
-
});
|
|
35
|
-
return global$1[GLOBAL_KEY];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
var DEV = getDEV();
|
|
22
|
+
var DEV = ("__DEV__" in global$1
|
|
23
|
+
? Boolean(global$1.__DEV__)
|
|
24
|
+
: maybe(function () { return process.env.NODE_ENV; }) !== "production");
|
|
39
25
|
|
|
40
26
|
function removeTemporaryGlobals() {
|
|
41
27
|
return typeof graphql.Source === "function" ? process$1.remove() : process$1.remove();
|
|
42
28
|
}
|
|
43
29
|
|
|
44
|
-
|
|
45
|
-
__DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 40);
|
|
46
|
-
}
|
|
30
|
+
var __DEV__ = DEV;
|
|
47
31
|
removeTemporaryGlobals();
|
|
48
|
-
checkDEV();
|
|
49
32
|
|
|
50
33
|
exports.InvariantError = tsInvariant.InvariantError;
|
|
51
34
|
exports.invariant = tsInvariant.invariant;
|
|
52
35
|
exports.DEV = DEV;
|
|
53
|
-
exports.
|
|
36
|
+
exports.__DEV__ = __DEV__;
|
|
54
37
|
exports.global = global$1;
|
|
55
38
|
exports.maybe = maybe;
|
|
56
39
|
//# sourceMappingURL=globals.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { invariant, InvariantError } from "ts-invariant";
|
|
2
2
|
import DEV from "./DEV";
|
|
3
3
|
export { DEV };
|
|
4
|
-
export declare
|
|
4
|
+
export declare const __DEV__: boolean;
|
|
5
5
|
export { maybe } from "./maybe";
|
|
6
6
|
export { default as global } from "./global";
|
|
7
7
|
export { invariant, InvariantError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,CAAC;AACf,eAAO,MAAM,OAAO,SAAM,CAAC;AAU3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { invariant, InvariantError } from "ts-invariant";
|
|
2
2
|
import DEV from "./DEV.js";
|
|
3
3
|
export { DEV };
|
|
4
|
-
export
|
|
5
|
-
__DEV__ ? invariant("boolean" === typeof DEV, DEV) : invariant("boolean" === typeof DEV, 40);
|
|
6
|
-
}
|
|
4
|
+
export var __DEV__ = DEV;
|
|
7
5
|
import { removeTemporaryGlobals } from "./fix-graphql.js";
|
|
8
6
|
removeTemporaryGlobals();
|
|
9
7
|
export { maybe } from "./maybe.js";
|
|
10
8
|
export { default as global } from "./global.js";
|
|
11
9
|
export { invariant, InvariantError };
|
|
12
|
-
checkDEV();
|
|
13
10
|
//# sourceMappingURL=index.js.map
|