@sanity/client
Advanced tools
Comparing version 6.21.3-canary.0 to 6.21.3
@@ -171,3 +171,3 @@ const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reKeySegment = /_key\s*==\s*['"](.*)['"]/, reIndexTuple = /^\d*:\d*$/; | ||
function resolveMapping(resultPath, csm) { | ||
if (!(csm != null && csm.mappings)) | ||
if (!csm?.mappings) | ||
return; | ||
@@ -174,0 +174,0 @@ const resultMappingPath = jsonPath(jsonPathToMappingPath(resultPath)); |
@@ -88,3 +88,3 @@ import { C } from "./stegaClean.js"; | ||
function resolveMapping(resultPath, csm) { | ||
if (!(csm != null && csm.mappings)) | ||
if (!csm?.mappings) | ||
return; | ||
@@ -248,10 +248,9 @@ const resultMappingPath = jsonPath(jsonPathToMappingPath(resultPath)); | ||
function stegaEncodeSourceMap(result, resultSourceMap, config) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _i; | ||
const { filter, logger, enabled } = config; | ||
if (!enabled) { | ||
const msg = "config.enabled must be true, don't call this function otherwise"; | ||
throw (_a = logger == null ? void 0 : logger.error) == null || _a.call(logger, `[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
throw logger?.error?.(`[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
} | ||
if (!resultSourceMap) | ||
return (_b = logger == null ? void 0 : logger.error) == null || _b.call(logger, "[@sanity/client]: Missing Content Source Map from response body", { | ||
return logger?.error?.("[@sanity/client]: Missing Content Source Map from response body", { | ||
result, | ||
@@ -263,3 +262,3 @@ resultSourceMap, | ||
const msg = "config.studioUrl must be defined"; | ||
throw (_c = logger == null ? void 0 : logger.error) == null || _c.call(logger, `[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
throw logger?.error?.(`[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
} | ||
@@ -311,12 +310,11 @@ const report = { | ||
const isSkipping = report.skipped.length, isEncoding = report.encoded.length; | ||
if ((isSkipping || isEncoding) && ((_d = (logger == null ? void 0 : logger.groupCollapsed) || logger.log) == null || _d("[@sanity/client]: Encoding source map into result"), (_e = logger.log) == null || _e.call( | ||
logger, | ||
if ((isSkipping || isEncoding) && ((logger?.groupCollapsed || logger.log)?.("[@sanity/client]: Encoding source map into result"), logger.log?.( | ||
`[@sanity/client]: Paths encoded: ${report.encoded.length}, skipped: ${report.skipped.length}` | ||
)), report.encoded.length > 0 && ((_f = logger == null ? void 0 : logger.log) == null || _f.call(logger, "[@sanity/client]: Table of encoded paths"), (_g = (logger == null ? void 0 : logger.table) || logger.log) == null || _g(report.encoded)), report.skipped.length > 0) { | ||
)), report.encoded.length > 0 && (logger?.log?.("[@sanity/client]: Table of encoded paths"), (logger?.table || logger.log)?.(report.encoded)), report.skipped.length > 0) { | ||
const skipped = /* @__PURE__ */ new Set(); | ||
for (const { path } of report.skipped) | ||
skipped.add(path.replace(reKeySegment, "0").replace(/\[\d+\]/g, "[]")); | ||
(_h = logger == null ? void 0 : logger.log) == null || _h.call(logger, "[@sanity/client]: List of skipped paths", [...skipped.values()]); | ||
logger?.log?.("[@sanity/client]: List of skipped paths", [...skipped.values()]); | ||
} | ||
(isSkipping || isEncoding) && ((_i = logger == null ? void 0 : logger.groupEnd) == null || _i.call(logger)); | ||
(isSkipping || isEncoding) && logger?.groupEnd?.(); | ||
} | ||
@@ -323,0 +321,0 @@ return resultWithStega; |
{ | ||
"name": "@sanity/client", | ||
"version": "6.21.3-canary.0", | ||
"version": "6.21.3", | ||
"description": "Client for retrieving, creating and patching data from Sanity.io", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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 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 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 too big to display
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 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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
2160230
24628