UNPKG

@prismicio/mock

Version:

Generate mock Prismic documents, fields, Slices, and models for development and testing environments

36 lines (35 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const prismic = require("@prismicio/client"); function _interopNamespaceDefault(e) { const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } }); if (e) { for (const k in e) { if (k !== "default") { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic); const buildContentRelationshipField = (config) => { return { link_type: prismic__namespace.LinkType.Document, id: config.document.id, uid: config.document.uid || void 0, type: config.document.type, tags: config.document.tags, lang: config.document.lang, url: config.document.url || void 0, slug: config.document.slugs[0], isBroken: false }; }; exports.buildContentRelationshipField = buildContentRelationshipField; //# sourceMappingURL=buildContentRelationshipField.cjs.map