@sanity/groq-store
Advanced tools
Comparing version 5.2.6-pink-lizard to 5.2.7-pink-lizard
# Changelog | ||
## [5.2.7-pink-lizard](https://github.com/sanity-io/visual-editing/compare/groq-store-v5.2.6-pink-lizard...groq-store-v5.2.7-pink-lizard) (2023-11-10) | ||
### Bug Fixes | ||
* **deps:** update dependency `@sanity/client` to ^6.8.0 ([4e11e0c](https://github.com/sanity-io/visual-editing/commit/4e11e0c1efd01e889c269d6a270b7c761b776fc0)) | ||
## [5.2.6-pink-lizard](https://github.com/sanity-io/visual-editing/compare/groq-store-v5.2.5-pink-lizard...groq-store-v5.2.6-pink-lizard) (2023-11-08) | ||
@@ -4,0 +11,0 @@ |
@@ -1,31 +0,1 @@ | ||
import LRUCache from 'mnemonist/lru-cache'; | ||
const unstable__documentsCache = new LRUCache(1024); | ||
function unstable__getDocumentCacheKey(config, document) { | ||
const { | ||
projectId, | ||
dataset, | ||
perspective | ||
} = config; | ||
const { | ||
_id | ||
} = document; | ||
if (![projectId, dataset, perspective, _id].every(input => typeof input === "string" && input.length > 0)) { | ||
throw new Error("Invalid document cache key, all inputs must be non-empty strings", { | ||
cause: { | ||
config, | ||
document | ||
} | ||
}); | ||
} | ||
if (perspective !== "published" && perspective !== "previewDrafts") { | ||
throw new Error('Invalid document cache key, perspective must be "published" or "previewDrafts"', { | ||
cause: { | ||
config, | ||
document | ||
} | ||
}); | ||
} | ||
return `${projectId}-${dataset}-${perspective}-${_id}`; | ||
} | ||
export { unstable__documentsCache, unstable__getDocumentCacheKey }; | ||
//# sourceMappingURL=index.js.map | ||
import e from"mnemonist/lru-cache";const t=new e(1024);function r(e,t){const{projectId:r,dataset:n,perspective:o}=e,{_id:c}=t;if(![r,n,o,c].every((e=>"string"==typeof e&&e.length>0)))throw new Error("Invalid document cache key, all inputs must be non-empty strings",{cause:{config:e,document:t}});if("published"!==o&&"previewDrafts"!==o)throw new Error('Invalid document cache key, perspective must be "published" or "previewDrafts"',{cause:{config:e,document:t}});return`${r}-${n}-${o}-${c}`}export{t as unstable__documentsCache,r as unstable__getDocumentCacheKey};//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sanity/groq-store", | ||
"version": "5.2.6-pink-lizard", | ||
"version": "5.2.7-pink-lizard", | ||
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/groq-store#readme", | ||
@@ -102,3 +102,3 @@ "bugs": { | ||
"devDependencies": { | ||
"@sanity/client": "6.8.0-pink-lizard.12", | ||
"@sanity/client": "^6.8.0", | ||
"@sanity/pkg-utils": "^3.2.3", | ||
@@ -116,3 +116,3 @@ "@typescript-eslint/eslint-plugin": "^6.10.0", | ||
"peerDependencies": { | ||
"@sanity/client": "6.8.0-pink-lizard.12" | ||
"@sanity/client": "^6.8.0" | ||
}, | ||
@@ -119,0 +119,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
37761
71
3