UNPKG

@sanity/desk-tool

Version:

Tool for managing all sorts of content in a structured manner

16 lines (15 loc) 446 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconWithFallback = getIconWithFallback; /** * Return `false` if we explicitly disable the icon. * Otherwise return the passed icon or the schema type icon as a backup. */ function getIconWithFallback(icon, schemaType, defaultIcon) { if (icon === false) { return false; } return icon || schemaType && schemaType.icon || defaultIcon || false; }