@sanity/data-aspects
Advanced tools
Comparing version 0.105.1 to 0.105.9
@@ -71,27 +71,2 @@ 'use strict'; | ||
}, { | ||
key: 'fallbackItemDisplayField', | ||
value: function fallbackItemDisplayField(typeName) { | ||
var type = this.getType(typeName); | ||
if (!type) { | ||
return null; | ||
} | ||
var fieldsForType = type.fields || []; | ||
var field = fieldsForType.find(function (currField) { | ||
return ['name', 'title', 'label'].includes(currField.name); | ||
}); | ||
return field ? field.name : null; | ||
} | ||
}, { | ||
key: 'getItemDisplayField', | ||
value: function getItemDisplayField(typeName) { | ||
var typeOption = this.config.typeOptions[typeName]; | ||
var displayField = typeOption && typeOption.itemDisplayField ? typeOption.itemDisplayField : this.fallbackItemDisplayField(typeName); | ||
if (!this.getField(this.getType(typeName), displayField)[0]) { | ||
throw new Error('resolved display field for type "' + typeName + '" to "' + displayField + '", but field does not exist in schema. check data-aspects config'); | ||
} | ||
return displayField; | ||
} | ||
}, { | ||
key: 'getDisplayName', | ||
@@ -98,0 +73,0 @@ value: function getDisplayName(typeName) { |
{ | ||
"name": "@sanity/data-aspects", | ||
"version": "0.105.1", | ||
"version": "0.105.9", | ||
"description": "Sanity plugin which controls how your data is presented", | ||
@@ -5,0 +5,0 @@ "main": "lib/DataAspectsResolver.js", |
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
6500
120