UNPKG

@prismicio/mock

Version:

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

46 lines (45 loc) 939 B
import { createFaker } from "../lib/createFaker.js"; import { ref } from "./ref.js"; import { repository } from "./repository.js"; import { query } from "./query.js"; import { tags } from "./tags.js"; //#region src/api/createAPIMockFactory.ts const createAPIMockFactory = (...args) => { return new APIMockFactory(...args); }; var APIMockFactory = class { faker; constructor(config) { this.faker = "faker" in config ? config.faker : createFaker(config.seed); } get seed() { return this.faker.seed; } query(config) { return query({ ...config, faker: this.faker }); } ref(config) { return ref({ ...config, faker: this.faker }); } repository(config) { return repository({ ...config, faker: this.faker }); } tags(config) { return tags({ ...config, faker: this.faker }); } }; //#endregion export { APIMockFactory, createAPIMockFactory }; //# sourceMappingURL=createAPIMockFactory.js.map