UNPKG

@prismicio/mock

Version:

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

1 lines 3.38 kB
{"version":3,"file":"getMockImageData.cjs","names":["createFaker"],"sources":["../../src/lib/getMockImageData.ts"],"sourcesContent":["import { createFaker, type Faker } from \"../lib/createFaker\"\nimport type { MockImageData, Seed } from \"../types\"\n\nconst dataSet: MockImageData[] = [\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1604537529428-15bcbeecfe4d\",\n\t\twidth: 4240,\n\t\theight: 2832,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05\",\n\t\twidth: 7372,\n\t\theight: 4392,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1441974231531-c6227db76b6e\",\n\t\twidth: 2560,\n\t\theight: 1705,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1418065460487-3e41a6c84dc5\",\n\t\twidth: 2200,\n\t\theight: 1467,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1426604966848-d7adac402bff\",\n\t\twidth: 5616,\n\t\theight: 3744,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1604537466608-109fa2f16c3b\",\n\t\twidth: 4240,\n\t\theight: 2832,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1497436072909-60f360e1d4b1\",\n\t\twidth: 2560,\n\t\theight: 1440,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/reserve/HgZuGu3gSD6db21T3lxm_San%20Zenone.jpg\",\n\t\twidth: 6373,\n\t\theight: 4253,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1504198266287-1659872e6590\",\n\t\twidth: 4272,\n\t\theight: 2848,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1470770903676-69b98201ea1c\",\n\t\twidth: 4554,\n\t\theight: 3036,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1587502537745-84b86da1204f\",\n\t\twidth: 6550,\n\t\theight: 4367,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1431794062232-2a99a5431c6c\",\n\t\twidth: 6000,\n\t\theight: 4000,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1446329813274-7c9036bd9a1f\",\n\t\twidth: 6000,\n\t\theight: 4000,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1504567961542-e24d9439a724\",\n\t\twidth: 4608,\n\t\theight: 3456,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1444464666168-49d633b86797\",\n\t\twidth: 4844,\n\t\theight: 3234,\n\t},\n\t{\n\t\turl: \"https://images.unsplash.com/photo-1553531384-397c80973a0b\",\n\t\twidth: 4335,\n\t\theight: 6502,\n\t},\n]\n\ntype GetMockImageDataConfig =\n\t| {\n\t\t\tseed: Seed\n\t\t\tfaker?: never\n\t }\n\t| {\n\t\t\tfaker: Faker\n\t\t\tseed?: never\n\t }\n\nexport const getMockImageData = (config: GetMockImageDataConfig): MockImageData => {\n\tconst faker = config.faker || createFaker(config.seed)\n\n\treturn faker.randomElement(dataSet)\n}\n"],"mappings":";;AAGA,MAAM,UAA2B;CAChC;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;EACC,KAAK;EACL,OAAO;EACP,QAAQ;EACR;CACD;AAYD,MAAa,oBAAoB,WAAkD;AAGlF,SAFc,OAAO,SAASA,oBAAAA,YAAY,OAAO,KAAK,EAEzC,cAAc,QAAQ"}