UNPKG

@prismicio/mock

Version:

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

22 lines (21 loc) 777 B
import * as prismic from "@prismicio/client"; import { capitalCase, sentenceCase } from "../lib/changeCase.js"; import { createFaker } from "../lib/createFaker.js"; const link = (config) => { const faker = config.faker || createFaker(config.seed); return { type: prismic.CustomTypeModelFieldType.Link, config: { label: capitalCase(faker.word()), placeholder: sentenceCase(faker.words(3)), select: null, allowTargetBlank: ("allowTargetBlank" in config ? config.allowTargetBlank : faker.boolean()) || void 0, allowText: ("allowText" in config ? config.allowText : faker.boolean()) || void 0, repeat: ("repeat" in config ? config.repeat : faker.boolean()) || void 0 } }; }; export { link }; //# sourceMappingURL=link.js.map