Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/schema

Package Overview
Dependencies
Maintainers
6
Versions
1381
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.105.15 to 0.106.1

44

lib/preview/guessPreviewConfig.js

@@ -15,4 +15,2 @@ '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;

@@ -54,27 +52,21 @@

if (!titleField && !imageField) {
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;
}, {});
// 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 {
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;
return {
select: fieldMapping,
prepare: function prepare(data) {
return {
title: fieldNames.map(function (name) {
return name + ': ' + JSON.stringify(data[name]);
}).join(' / ')
};
}
};
}

@@ -81,0 +73,0 @@

@@ -32,3 +32,2 @@ 'use strict';

var INHERITED_FIELDS = ['fields', 'fieldsets'];
var OVERRIDABLE_FIELDS = ['jsonType', 'type', 'name', 'title', 'description', 'options'];

@@ -57,5 +56,11 @@

var compiledField = { name: name, fieldset: fieldset };
var compiledField = {
name: name,
fieldset: fieldset
};
return (0, _utils.lazyGetter)(compiledField, 'type', function () {
return createMemberType(rest);
return createMemberType(_extends({}, rest, {
title: fieldDef.title || (0, _startCase3.default)(name)
}));
});

@@ -62,0 +67,0 @@ })

{
"name": "@sanity/schema",
"version": "0.105.15",
"version": "0.106.1",
"description": "",

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc