UNPKG

@sanity/desk-tool

Version:

Tool for managing all sorts of content in a structured manner

23 lines (22 loc) 733 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _structure = require("@sanity/structure"); var _default = structure => { if (!structure) { var val = 'null'; if (structure !== null) { val = typeof structure === 'undefined' ? 'undefined' : 'false'; } throw new _structure.SerializeError("Structure resolved to ".concat(val), [], 'root'); } if (!structure.id) { throw new _structure.SerializeError('Structure did not contain required `id` property', [], 'root'); } if (structure.id === 'edit') { throw new _structure.SerializeError('The root structure cannot have value `edit` as `id`', [], 'root'); } }; exports.default = _default;