Socket
Socket
Sign inDemoInstall

@sanity/schema

Package Overview
Dependencies
Maintainers
7
Versions
1328
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/schema - npm Package Compare versions

Comparing version 0.103.11 to 0.103.12

45

lib/preview/guessPreviewConfig.js

@@ -6,2 +6,5 @@ 'use strict';

});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.default = guessPreviewFields;

@@ -48,21 +51,27 @@ var TITLE_CANDIDATES = ['title', 'name', 'label', 'heading', 'header', 'caption'];

if (!titleField) {
// last resort, pick all fields and concat them
var fieldNames = fields.map(function (field) {
return field.name;
});
var fieldMapping = fieldNames.reduce(function (acc, fieldName) {
acc[fieldName] = fieldName;
return acc;
}, {});
var _ret = function () {
// last resort, pick all fields and concat them
var fieldNames = fields.map(function (field) {
return field.name;
});
var fieldMapping = fieldNames.reduce(function (acc, fieldName) {
acc[fieldName] = fieldName;
return acc;
}, {});
return {
select: fieldMapping,
prepare: function prepare(data) {
return {
title: fieldNames.map(function (name) {
return name + ': ' + JSON.stringify(data[name]);
}).join(' / ')
};
}
};
return {
v: {
select: fieldMapping,
prepare: function prepare(data) {
return {
title: fieldNames.map(function (name) {
return name + ': ' + JSON.stringify(data[name]);
}).join(' / ')
};
}
}
};
}();
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
}

@@ -69,0 +78,0 @@

2

package.json
{
"name": "@sanity/schema",
"version": "0.103.11",
"version": "0.103.12",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc