@sanity/client
Advanced tools
Comparing version 6.15.10 to 6.15.11
@@ -184,3 +184,3 @@ import { g as b } from "./browserMiddleware.js"; | ||
} | ||
const filterDefault = ({ sourcePath, value }) => { | ||
const filterDefault = ({ sourcePath, resultPath, value }) => { | ||
if (isValidDate(value) || isValidURL(value)) | ||
@@ -191,3 +191,3 @@ return !1; | ||
(path) => path === "meta" || path === "metadata" || path === "openGraph" || path === "seo" | ||
) || typeof endPath == "string" && denylist.has(endPath)); | ||
) || hasTypeLike(sourcePath) || hasTypeLike(resultPath) || typeof endPath == "string" && denylist.has(endPath)); | ||
}, denylist = /* @__PURE__ */ new Set([ | ||
@@ -244,2 +244,5 @@ "color", | ||
} | ||
function hasTypeLike(path) { | ||
return path.some((segment) => typeof segment == "string" && segment.match(/type/i) !== null); | ||
} | ||
const TRUNCATE_LENGTH = 20; | ||
@@ -246,0 +249,0 @@ function stegaEncodeSourceMap(result, resultSourceMap, config) { |
{ | ||
"name": "@sanity/client", | ||
"version": "6.15.10", | ||
"version": "6.15.11", | ||
"description": "Client for retrieving, creating and patching data from Sanity.io", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,4 +0,4 @@ | ||
import type {FilterDefault} from './types' | ||
import type {ContentSourceMapParsedPath, FilterDefault} from './types' | ||
export const filterDefault: FilterDefault = ({sourcePath, value}) => { | ||
export const filterDefault: FilterDefault = ({sourcePath, resultPath, value}) => { | ||
// Skips encoding on URL or Date strings, similar to the `skip: 'auto'` parameter in vercelStegaCombine() | ||
@@ -53,2 +53,8 @@ if (isValidDate(value) || isValidURL(value)) { | ||
// If the sourcePath or resultPath contains something that sounds like a type, like iconType, we skip encoding, as it's most | ||
// of the time used for logic that breaks if it contains stega characters | ||
if (hasTypeLike(sourcePath) || hasTypeLike(resultPath)) { | ||
return false | ||
} | ||
// Finally, we ignore a bunch of paths that are typically used for page building | ||
@@ -115,1 +121,5 @@ if (typeof endPath === 'string' && denylist.has(endPath)) { | ||
} | ||
function hasTypeLike(path: ContentSourceMapParsedPath): boolean { | ||
return path.some((segment) => typeof segment === 'string' && segment.match(/type/i) !== null) | ||
} |
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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2509730
29784