@apollo/client 4.0.9 → 4.0.13

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.
Files changed (134) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/__cjs/cache/core/cache.cjs +49 -6
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +47 -0
  5. package/__cjs/cache/core/types/Cache.d.cts +28 -0
  6. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  7. package/__cjs/cache/inmemory/fragmentRegistry.cjs +5 -0
  8. package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
  9. package/__cjs/cache/inmemory/inMemoryCache.cjs +47 -0
  10. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  11. package/__cjs/cache/inmemory/inMemoryCache.d.cts +47 -0
  12. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  13. package/__cjs/cache/inmemory/policies.cjs +4 -4
  14. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  15. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  16. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  17. package/__cjs/core/ApolloClient.cjs.map +1 -1
  18. package/__cjs/core/ApolloClient.d.cts +16 -1
  19. package/__cjs/core/ObservableQuery.cjs +18 -7
  20. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  21. package/__cjs/core/ObservableQuery.d.cts +1 -0
  22. package/__cjs/core/QueryManager.cjs +13 -13
  23. package/__cjs/core/QueryManager.cjs.map +1 -1
  24. package/__cjs/invariantErrorCodes.cjs +39 -33
  25. package/__cjs/link/error/index.cjs +1 -1
  26. package/__cjs/link/error/index.cjs.map +1 -1
  27. package/__cjs/link/error/index.d.cts +1 -1
  28. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  29. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  30. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +51 -50
  31. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  32. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +3 -0
  33. package/__cjs/link/schema/index.cjs +1 -1
  34. package/__cjs/link/schema/index.cjs.map +1 -1
  35. package/__cjs/link/schema/index.d.cts +1 -1
  36. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  37. package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
  38. package/__cjs/react/hooks/useApolloClient.d.cts +1 -1
  39. package/__cjs/react/hooks/useLazyQuery.cjs +1 -0
  40. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  41. package/__cjs/react/hooks/useQuery.cjs +7 -4
  42. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  43. package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -0
  44. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  45. package/__cjs/utilities/internal/bindCacheKey.cjs +21 -0
  46. package/__cjs/utilities/internal/bindCacheKey.cjs.map +1 -0
  47. package/__cjs/utilities/internal/bindCacheKey.d.cts +15 -0
  48. package/__cjs/utilities/internal/checkDocument.cjs +2 -4
  49. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  50. package/__cjs/utilities/internal/compact.cjs +1 -1
  51. package/__cjs/utilities/internal/compact.cjs.map +1 -1
  52. package/__cjs/utilities/internal/constants.cjs +13 -0
  53. package/__cjs/utilities/internal/constants.cjs.map +1 -0
  54. package/__cjs/utilities/internal/constants.d.cts +10 -0
  55. package/__cjs/utilities/internal/index.cjs +6 -2
  56. package/__cjs/utilities/internal/index.cjs.map +1 -1
  57. package/__cjs/utilities/internal/index.d.cts +2 -0
  58. package/__cjs/utilities/internal/memoize.cjs +31 -0
  59. package/__cjs/utilities/internal/memoize.cjs.map +1 -0
  60. package/__cjs/utilities/internal/memoize.d.cts +7 -0
  61. package/__cjs/version.cjs +1 -1
  62. package/__cjs/version.cjs.map +1 -1
  63. package/cache/core/cache.d.ts +47 -0
  64. package/cache/core/cache.js +50 -7
  65. package/cache/core/cache.js.map +1 -1
  66. package/cache/core/types/Cache.d.ts +28 -0
  67. package/cache/core/types/Cache.js.map +1 -1
  68. package/cache/inmemory/entityStore.js +3 -3
  69. package/cache/inmemory/fragmentRegistry.js +6 -1
  70. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  71. package/cache/inmemory/inMemoryCache.d.ts +47 -0
  72. package/cache/inmemory/inMemoryCache.js +47 -0
  73. package/cache/inmemory/inMemoryCache.js.map +1 -1
  74. package/cache/inmemory/key-extractor.js +1 -1
  75. package/cache/inmemory/policies.js +4 -4
  76. package/cache/inmemory/policies.js.map +1 -1
  77. package/cache/inmemory/readFromStore.js +2 -2
  78. package/cache/inmemory/writeToStore.js +4 -4
  79. package/core/ApolloClient.d.ts +16 -1
  80. package/core/ApolloClient.js.map +1 -1
  81. package/core/ObservableQuery.d.ts +1 -0
  82. package/core/ObservableQuery.js +19 -8
  83. package/core/ObservableQuery.js.map +1 -1
  84. package/core/QueryManager.js +13 -13
  85. package/core/QueryManager.js.map +1 -1
  86. package/invariantErrorCodes.js +39 -33
  87. package/link/error/index.d.ts +1 -1
  88. package/link/error/index.js +1 -1
  89. package/link/error/index.js.map +1 -1
  90. package/link/http/parseAndCheckHttpResponse.js +1 -1
  91. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  92. package/link/remove-typename/removeTypenameFromVariables.d.ts +3 -0
  93. package/link/remove-typename/removeTypenameFromVariables.js +51 -50
  94. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  95. package/link/schema/index.d.ts +1 -1
  96. package/link/schema/index.js +1 -1
  97. package/link/schema/index.js.map +1 -1
  98. package/package.json +1 -1
  99. package/react/hooks/useApolloClient.d.ts +1 -1
  100. package/react/hooks/useApolloClient.js +1 -1
  101. package/react/hooks/useApolloClient.js.map +1 -1
  102. package/react/hooks/useLazyQuery.js +2 -1
  103. package/react/hooks/useLazyQuery.js.map +1 -1
  104. package/react/hooks/useQuery.js +8 -5
  105. package/react/hooks/useQuery.js.map +1 -1
  106. package/react/hooks/useSuspenseQuery.js +2 -0
  107. package/react/hooks/useSuspenseQuery.js.map +1 -1
  108. package/react/hooks-compiled/useApolloClient.d.ts +1 -1
  109. package/react/hooks-compiled/useApolloClient.js +1 -1
  110. package/react/hooks-compiled/useApolloClient.js.map +1 -1
  111. package/react/hooks-compiled/useLazyQuery.js +2 -1
  112. package/react/hooks-compiled/useLazyQuery.js.map +1 -1
  113. package/react/hooks-compiled/useQuery.js +9 -5
  114. package/react/hooks-compiled/useQuery.js.map +1 -1
  115. package/react/hooks-compiled/useSuspenseQuery.js +3 -1
  116. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
  117. package/utilities/internal/bindCacheKey.d.ts +15 -0
  118. package/utilities/internal/bindCacheKey.js +18 -0
  119. package/utilities/internal/bindCacheKey.js.map +1 -0
  120. package/utilities/internal/checkDocument.js +2 -4
  121. package/utilities/internal/checkDocument.js.map +1 -1
  122. package/utilities/internal/compact.js +1 -1
  123. package/utilities/internal/compact.js.map +1 -1
  124. package/utilities/internal/constants.d.ts +10 -0
  125. package/utilities/internal/constants.js +10 -0
  126. package/utilities/internal/constants.js.map +1 -0
  127. package/utilities/internal/index.d.ts +2 -0
  128. package/utilities/internal/index.js +2 -0
  129. package/utilities/internal/index.js.map +1 -1
  130. package/utilities/internal/memoize.d.ts +7 -0
  131. package/utilities/internal/memoize.js +28 -0
  132. package/utilities/internal/memoize.js.map +1 -0
  133. package/version.js +1 -1
  134. package/version.js.map +1 -1
@@ -47,6 +47,8 @@ export { toQueryResult } from "./toQueryResult.js";
47
47
  export { filterMap } from "./filterMap.js";
48
48
  export { equalByQuery } from "./equalByQuery.js";
49
49
  export { canonicalStringify } from "./canonicalStringify.js";
50
+ export { variablesUnknownSymbol } from "./constants.js";
51
+ export { bindCacheKey } from "./bindCacheKey.js";
50
52
  export { getApolloCacheMemoryInternals, getApolloClientMemoryInternals, getInMemoryCacheMemoryInternals, registerGlobalCache, } from "../internal/getMemoryInternals.js";
51
53
  export { AutoCleanedStrongCache, AutoCleanedWeakCache } from "./caches.js";
52
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,gBAAgB,E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AE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { DecoratedPromise } from \"./types/DecoratedPromise.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\nexport type { DocumentationTypes } from \"./types/DocumentationTypes.js\";\n\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { removeMaskedFragmentSpreads } from \"./removeFragmentSpreads.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\nexport { equalByQuery } from \"./equalByQuery.js\";\nexport { canonicalStringify } from \"./canonicalStringify.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,wBAAwB,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AQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { DecoratedPromise } from \"./types/DecoratedPromise.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\nexport type { DocumentationTypes } from \"./types/DocumentationTypes.js\";\n\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { removeMaskedFragmentSpreads } from \"./removeFragmentSpreads.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\nexport { equalByQuery } from \"./equalByQuery.js\";\nexport { canonicalStringify } from \"./canonicalStringify.js\";\nexport { variablesUnknownSymbol } from \"./constants.js\";\nexport { bindCacheKey } from \"./bindCacheKey.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Naive alternative to `wrap` without any dependency tracking, potentially avoiding resulting memory leaks.
3
+ */
4
+ export declare function memoize<TArgs extends any[], TResult>(fn: (...args: TArgs) => TResult, { max }: {
5
+ max: number;
6
+ }): (...args: TArgs) => TResult;
7
+ //# sourceMappingURL=memoize.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { Trie } from "@wry/trie";
2
+ import { AutoCleanedWeakCache } from "./caches.js";
3
+ /**
4
+ * Naive alternative to `wrap` without any dependency tracking, potentially avoiding resulting memory leaks.
5
+ */
6
+ export function memoize(fn, { max }) {
7
+ const keys = new Trie(true);
8
+ const cache = new AutoCleanedWeakCache(max);
9
+ return (...args) => {
10
+ const cacheKey = keys.lookupArray(args);
11
+ const cached = cache.get(cacheKey);
12
+ if (cached) {
13
+ if (cached.error) {
14
+ throw cached.error;
15
+ }
16
+ return cached.result;
17
+ }
18
+ const entry = cache.set(cacheKey, {});
19
+ try {
20
+ return (entry.result = fn(...args));
21
+ }
22
+ catch (error) {
23
+ entry.error = error;
24
+ throw error;
25
+ }
26
+ };
27
+ }
28
+ //# sourceMappingURL=memoize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoize.js","sourceRoot":"","sources":["../../../src/utilities/internal/memoize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,EAA+B,EAC/B,EAAE,GAAG,EAAmB;IAExB,MAAM,IAAI,GAAG,IAAI,IAAI,CAAK,IAAI,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAGpC,GAAG,CAAC,CAAC;IAEP,OAAO,CAAC,GAAG,IAAW,EAAW,EAAE;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACjB,MAAM,MAAM,CAAC,KAAK,CAAC;YACrB,CAAC;YACD,OAAO,MAAM,CAAC,MAAO,CAAC;QACxB,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC;YACH,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;YACpB,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { Trie } from \"@wry/trie\";\n\nimport { AutoCleanedWeakCache } from \"./caches.js\";\n\n/**\n * Naive alternative to `wrap` without any dependency tracking, potentially avoiding resulting memory leaks.\n */\nexport function memoize<TArgs extends any[], TResult>(\n fn: (...args: TArgs) => TResult,\n { max }: { max: number }\n): (...args: TArgs) => TResult {\n const keys = new Trie<{}>(true);\n const cache = new AutoCleanedWeakCache<\n {},\n { result?: TResult; error?: unknown }\n >(max);\n\n return (...args: TArgs): TResult => {\n const cacheKey = keys.lookupArray(args);\n const cached = cache.get(cacheKey);\n if (cached) {\n if (cached.error) {\n throw cached.error;\n }\n return cached.result!;\n }\n\n const entry = cache.set(cacheKey, {});\n try {\n return (entry.result = fn(...args));\n } catch (error) {\n entry.error = error;\n throw error;\n }\n };\n}\n"]}
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const version = "4.0.9";
1
+ export const version = "4.0.13";
2
2
  export const build = "esm";
3
3
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["export const version = \"local\" as string;\nexport const build = \"source\" as \"source\" | \"esm\" | \"cjs\";\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAP,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,SAAwC;AACxC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAP,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,EAAA,OAAyD;"}
1
+ {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["export const version = \"local\" as string;\nexport const build = \"source\" as \"source\" | \"esm\" | \"cjs\";\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAP,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,UAAwC;AACxC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAP,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,EAAA,OAAyD;"}