@sanity/schema 6.7.0-next.53 → 6.7.0-next.61

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.
@@ -359,10 +359,12 @@ function getCachedBaseFieldPaths(type, maxDepth) {
359
359
  return type[symbol] || (type[symbol] = uniqBy([...BASE_WEIGHTS, ...deriveFromPreview(type, maxDepth)], (spec) => spec.path.join("."))), type[symbol];
360
360
  }
361
361
  function getStringFieldPaths(type, maxDepth) {
362
- return reduceType(type, (accumulator, childType, path) => childType.jsonType === "string" ? [...accumulator, path] : accumulator, [], [], maxDepth);
362
+ let reducer = (accumulator, childType, path) => childType.jsonType === "string" ? [...accumulator, path] : accumulator;
363
+ return reduceType(type, reducer, [], [], maxDepth);
363
364
  }
364
365
  function getPortableTextFieldPaths(type, maxDepth) {
365
- return reduceType(type, (accumulator, childType, path) => isPortableTextArray(childType) ? [...accumulator, path] : accumulator, [], [], maxDepth);
366
+ let reducer = (accumulator, childType, path) => isPortableTextArray(childType) ? [...accumulator, path] : accumulator;
367
+ return reduceType(type, reducer, [], [], maxDepth);
366
368
  }
367
369
  function resolveSearchConfigForBaseFieldPaths(type, maxDepth) {
368
370
  return getCachedBaseFieldPaths(type, normalizeMaxDepth(maxDepth));
@@ -588,7 +590,7 @@ function parsePreview(preview) {
588
590
  };
589
591
  }
590
592
  function createPreviewGetter(objectTypeDef) {
591
- return function() {
593
+ return function previewGetter() {
592
594
  return warnIfPreviewOnOptions(objectTypeDef), warnIfPreviewHasFields(objectTypeDef), parsePreview(objectTypeDef.preview || (objectTypeDef.options || {}).preview) || guessPreviewFields(objectTypeDef);
593
595
  };
594
596
  }
@@ -1673,4 +1675,4 @@ var Schema = class Schema {
1673
1675
  };
1674
1676
  export { DEFAULT_MAX_FIELD_DEPTH as a, ALL_FIELDS_GROUP_NAME as c, DEFAULT_DECORATORS as i, OWN_PROPS_NAME as l, Schema as n, resolveSearchConfig as o, DEFAULT_ANNOTATIONS as r, resolveSearchConfigForBaseFieldPaths as s, DeprecatedDefaultSchema as t, Rule as u };
1675
1677
 
1676
- //# sourceMappingURL=Schema-B6NrqInd.js.map
1678
+ //# sourceMappingURL=Schema-BckCkziq.js.map