From bbf5328b4a8ba46e3831da82cea6af4b5f93c20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:59:15 -0300 Subject: [PATCH 1/9] refactor(image): randomize defaults --- src/modules/image/index.ts | 54 ++++++---- test/modules/__snapshots__/image.spec.ts.snap | 102 +++++++++--------- 2 files changed, 84 insertions(+), 72 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index a93f181e131..a1e0e143abc 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -102,8 +102,8 @@ export class ImageModule { * Generates a random image url. * * @param options Options for generating a URL for an image. - * @param options.width The width of the image. Defaults to `640`. - * @param options.height The height of the image. Defaults to `480`. + * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. * * @example * faker.image.url() // 'https://loremflickr.com/640/480?lock=1234' @@ -115,18 +115,21 @@ export class ImageModule { /** * The width of the image. * - * @default 640 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default 480 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ height?: number; } = {} ): string { - const { width = 640, height = 480 } = options; + const { + width = this.faker.number.int({ min: 1, max: 3999 }), + height = this.faker.number.int({ min: 1, max: 3999 }), + } = options; const urlMethod = this.faker.helpers.arrayElement([ this.urlLoremFlickr, @@ -140,8 +143,8 @@ export class ImageModule { * Generates a random image url provided via https://loremflickr.com. * * @param options Options for generating a URL for an image. - * @param options.width The width of the image. Defaults to `640`. - * @param options.height The height of the image. Defaults to `480`. + * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. * @param options.category Category to use for the image. * * @example @@ -157,13 +160,13 @@ export class ImageModule { /** * The width of the image. * - * @default 640 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default 480 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ height?: number; /** @@ -172,7 +175,11 @@ export class ImageModule { category?: string; } = {} ): string { - const { width = 640, height = 480, category } = options; + const { + width = this.faker.number.int({ min: 1, max: 3999 }), + height = this.faker.number.int({ min: 1, max: 3999 }), + category, + } = options; return `https://loremflickr.com/${width}/${height}${ category != null ? `/${category}` : '' @@ -183,8 +190,8 @@ export class ImageModule { * Generates a random image url provided via https://picsum.photos. * * @param options Options for generating a URL for an image. - * @param options.width The width of the image. Defaults to `640`. - * @param options.height The height of the image. Defaults to `480`. + * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. * @param options.grayscale Whether the image should be grayscale. Defaults to `false`. * @param options.blur Whether the image should be blurred. Defaults to `false`. * @@ -203,13 +210,13 @@ export class ImageModule { /** * The width of the image. * - * @default 640 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default 480 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ height?: number; /** @@ -226,7 +233,12 @@ export class ImageModule { blur?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; } = {} ): string { - const { width = 640, height = 480, grayscale = false, blur } = options; + const { + width = this.faker.number.int({ min: 1, max: 3999 }), + height = this.faker.number.int({ min: 1, max: 3999 }), + grayscale = false, + blur, + } = options; let url = `https://picsum.photos/seed/${this.faker.string.alphanumeric({ length: { min: 5, max: 10 }, @@ -351,8 +363,8 @@ export class ImageModule { * Generates a random data uri containing an URL-encoded SVG image or a Base64-encoded SVG image. * * @param options Options for generating a data uri. - * @param options.width The width of the image. Defaults to `640`. - * @param options.height The height of the image. Defaults to `480`. + * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. * @param options.color The color of the image. Must be a color supported by svg. Defaults to a random color. * @param options.type The type of the image. Defaults to `'svg-uri'`. * @@ -367,13 +379,13 @@ export class ImageModule { /** * The width of the image. * - * @default 640 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default 480 + * @default this.faker.number.int({ min: 1, max: 3999 }) */ height?: number; /** @@ -392,8 +404,8 @@ export class ImageModule { } = {} ): string { const { - width = 640, - height = 480, + width = this.faker.number.int({ min: 1, max: 3999 }), + height = this.faker.number.int({ min: 1, max: 3999 }), color = this.faker.color.rgb(), type = 'svg-uri', } = options; diff --git a/test/modules/__snapshots__/image.spec.ts.snap b/test/modules/__snapshots__/image.spec.ts.snap index 38eab14eb1e..f5b402d1edc 100644 --- a/test/modules/__snapshots__/image.spec.ts.snap +++ b/test/modules/__snapshots__/image.spec.ts.snap @@ -6,53 +6,53 @@ exports[`image > 42 > avatarGitHub 1`] = `"https://avatars.githubusercontent.com exports[`image > 42 > avatarLegacy 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/468.jpg"`; -exports[`image > 42 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%238be4ab%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221498%22%20height%3D%223186%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23e4abdd%22%2F%3E%3Ctext%20x%3D%22749%22%20y%3D%221593%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1498x3186%3C%2Ftext%3E%3C%2Fsvg%3E"`; exports[`image > 42 > dataUri > with all options+base64 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzMzciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiM2NDMyMTgiLz48dGV4dCB4PSIxIiB5PSI2NjguNSIgZm9udC1zaXplPSIyMCIgYWxpZ25tZW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4yeDEzMzc8L3RleHQ+PC9zdmc+"`; exports[`image > 42 > dataUri > with all options+uri 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%2242%22%20height%3D%22314%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%2221%22%20y%3D%22157%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E42x314%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 42 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221498%22%20height%3D%223186%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22749%22%20y%3D%221593%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1498x3186%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 42 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%238be4ab%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221498%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23be4abd%22%2F%3E%3Ctext%20x%3D%22749%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1498x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 42 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSI2NDAiIGhlaWdodD0iNDgwIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjOGJlNGFiIi8+PHRleHQgeD0iMzIwIiB5PSIyNDAiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+NjQweDQ4MDwvdGV4dD48L3N2Zz4="`; +exports[`image > 42 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxNDk4IiBoZWlnaHQ9IjMxODYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNlNGFiZGQiLz48dGV4dCB4PSI3NDkiIHk9IjE1OTMiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTQ5OHgzMTg2PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%238be4ab%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%221498%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23be4abd%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22749%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x1498%3C%2Ftext%3E%3C%2Fsvg%3E"`; exports[`image > 42 > dataUri > with width and height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%238be4ab%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 42 > url > noArgs 1`] = `"https://loremflickr.com/640/480?lock=7174621373661184"`; +exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/JMBB9r/1498/3186"`; -exports[`image > 42 > url > with height 1`] = `"https://loremflickr.com/640/128?lock=7174621373661184"`; +exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/128"`; -exports[`image > 42 > url > with width 1`] = `"https://loremflickr.com/128/480?lock=7174621373661184"`; +exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/bJMBB9r963/128/1498"`; exports[`image > 42 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=7174621373661184"`; -exports[`image > 42 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/640/480?lock=3373557438480384"`; +exports[`image > 42 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/1498/3186?lock=8563273238577152"`; exports[`image > 42 > urlLoremFlickr > with all options 1`] = `"https://loremflickr.com/128/128/cats?lock=3373557438480384"`; -exports[`image > 42 > urlLoremFlickr > with category 1`] = `"https://loremflickr.com/640/480/cats?lock=3373557438480384"`; +exports[`image > 42 > urlLoremFlickr > with category 1`] = `"https://loremflickr.com/1498/3186/cats?lock=8563273238577152"`; -exports[`image > 42 > urlLoremFlickr > with height 1`] = `"https://loremflickr.com/640/128?lock=3373557438480384"`; +exports[`image > 42 > urlLoremFlickr > with height 1`] = `"https://loremflickr.com/1498/128?lock=7174621373661184"`; -exports[`image > 42 > urlLoremFlickr > with width 1`] = `"https://loremflickr.com/128/480?lock=3373557438480384"`; +exports[`image > 42 > urlLoremFlickr > with width 1`] = `"https://loremflickr.com/128/1498?lock=7174621373661184"`; exports[`image > 42 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=3373557438480384"`; -exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/NWbJMBB/640/480"`; +exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186"`; exports[`image > 42 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/NWbJMBB/128/128?grayscale&blur=4"`; -exports[`image > 42 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/NWbJMBB/640/480?blur=6"`; +exports[`image > 42 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186?blur=6"`; -exports[`image > 42 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/NWbJMBB/640/480?grayscale&blur=3"`; +exports[`image > 42 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186?grayscale&blur=3"`; -exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/NWbJMBB/640/128"`; +exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/WbJMBB9r9/1498/128"`; -exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/NWbJMBB/128/480"`; +exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/WbJMBB9r9/128/1498"`; exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/NWbJMBB/128/128"`; @@ -82,53 +82,53 @@ exports[`image > 1211 > avatarGitHub 1`] = `"https://avatars.githubusercontent.c exports[`image > 1211 > avatarLegacy 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1160.jpg"`; -exports[`image > 1211 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23eadb42%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%223714%22%20height%3D%221836%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23db42f0%22%2F%3E%3Ctext%20x%3D%221857%22%20y%3D%22918%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E3714x1836%3C%2Ftext%3E%3C%2Fsvg%3E"`; exports[`image > 1211 > dataUri > with all options+base64 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzMzciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiM2NDMyMTgiLz48dGV4dCB4PSIxIiB5PSI2NjguNSIgZm9udC1zaXplPSIyMCIgYWxpZ25tZW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4yeDEzMzc8L3RleHQ+PC9zdmc+"`; exports[`image > 1211 > dataUri > with all options+uri 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%2242%22%20height%3D%22314%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%2221%22%20y%3D%22157%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E42x314%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1211 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%223714%22%20height%3D%221836%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%221857%22%20y%3D%22918%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E3714x1836%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1211 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23eadb42%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%223714%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23adb42f%22%2F%3E%3Ctext%20x%3D%221857%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E3714x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1211 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSI2NDAiIGhlaWdodD0iNDgwIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZWFkYjQyIi8+PHRleHQgeD0iMzIwIiB5PSIyNDAiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+NjQweDQ4MDwvdGV4dD48L3N2Zz4="`; +exports[`image > 1211 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIzNzE0IiBoZWlnaHQ9IjE4MzYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNkYjQyZjAiLz48dGV4dCB4PSIxODU3IiB5PSI5MTgiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MzcxNHgxODM2PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23eadb42%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%223714%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23adb42f%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%221857%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x3714%3C%2Ftext%3E%3C%2Fsvg%3E"`; exports[`image > 1211 > dataUri > with width and height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23eadb42%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/TMd8Z2F/640/480"`; +exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/1836"`; -exports[`image > 1211 > url > with height 1`] = `"https://picsum.photos/seed/TMd8Z2F/640/128"`; +exports[`image > 1211 > url > with height 1`] = `"https://loremflickr.com/3714/128?lock=8047677172350976"`; -exports[`image > 1211 > url > with width 1`] = `"https://picsum.photos/seed/TMd8Z2F/128/480"`; +exports[`image > 1211 > url > with width 1`] = `"https://loremflickr.com/128/3714?lock=8047677172350976"`; exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/TMd8Z2F/128/128"`; -exports[`image > 1211 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/640/480?lock=8363366036799488"`; +exports[`image > 1211 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/3714/1836?lock=8047677172350976"`; exports[`image > 1211 > urlLoremFlickr > with all options 1`] = `"https://loremflickr.com/128/128/cats?lock=8363366036799488"`; -exports[`image > 1211 > urlLoremFlickr > with category 1`] = `"https://loremflickr.com/640/480/cats?lock=8363366036799488"`; +exports[`image > 1211 > urlLoremFlickr > with category 1`] = `"https://loremflickr.com/3714/1836/cats?lock=8047677172350976"`; -exports[`image > 1211 > urlLoremFlickr > with height 1`] = `"https://loremflickr.com/640/128?lock=8363366036799488"`; +exports[`image > 1211 > urlLoremFlickr > with height 1`] = `"https://loremflickr.com/3714/128?lock=4134441414819840"`; -exports[`image > 1211 > urlLoremFlickr > with width 1`] = `"https://loremflickr.com/128/480?lock=8363366036799488"`; +exports[`image > 1211 > urlLoremFlickr > with width 1`] = `"https://loremflickr.com/128/3714?lock=4134441414819840"`; exports[`image > 1211 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=8363366036799488"`; -exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/640/480"`; +exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836"`; exports[`image > 1211 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/128?grayscale&blur=4"`; -exports[`image > 1211 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/640/480?blur=6"`; +exports[`image > 1211 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836?blur=6"`; -exports[`image > 1211 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/640/480?grayscale&blur=3"`; +exports[`image > 1211 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836?grayscale&blur=3"`; -exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/640/128"`; +exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/TMd8Z2F/3714/128"`; -exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/480"`; +exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/TMd8Z2F/128/3714"`; exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/128"`; @@ -158,53 +158,53 @@ exports[`image > 1337 > avatarGitHub 1`] = `"https://avatars.githubusercontent.c exports[`image > 1337 > avatarLegacy 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/327.jpg"`; -exports[`image > 1337 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%235c346b%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221048%22%20height%3D%222242%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23346ba0%22%2F%3E%3Ctext%20x%3D%22524%22%20y%3D%221121%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1048x2242%3C%2Ftext%3E%3C%2Fsvg%3E"`; exports[`image > 1337 > dataUri > with all options+base64 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzMzciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiM2NDMyMTgiLz48dGV4dCB4PSIxIiB5PSI2NjguNSIgZm9udC1zaXplPSIyMCIgYWxpZ25tZW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4yeDEzMzc8L3RleHQ+PC9zdmc+"`; exports[`image > 1337 > dataUri > with all options+uri 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%2242%22%20height%3D%22314%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%2221%22%20y%3D%22157%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E42x314%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1337 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221048%22%20height%3D%222242%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22524%22%20y%3D%221121%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1048x2242%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1337 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22640%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%235c346b%22%2F%3E%3Ctext%20x%3D%22320%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E640x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221048%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23c346ba%22%2F%3E%3Ctext%20x%3D%22524%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1048x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1337 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSI2NDAiIGhlaWdodD0iNDgwIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjNWMzNDZiIi8+PHRleHQgeD0iMzIwIiB5PSIyNDAiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+NjQweDQ4MDwvdGV4dD48L3N2Zz4="`; +exports[`image > 1337 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMDQ4IiBoZWlnaHQ9IjIyNDIiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiMzNDZiYTAiLz48dGV4dCB4PSI1MjQiIHk9IjExMjEiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTA0OHgyMjQyPC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1337 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22480%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%235c346b%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22240%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x480%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%221048%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23c346ba%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22524%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x1048%3C%2Ftext%3E%3C%2Fsvg%3E"`; exports[`image > 1337 > dataUri > with width and height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%235c346b%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1337 > url > noArgs 1`] = `"https://loremflickr.com/640/480?lock=5048803172286464"`; +exports[`image > 1337 > url > noArgs 1`] = `"https://loremflickr.com/1048/2242?lock=1914819313664000"`; -exports[`image > 1337 > url > with height 1`] = `"https://loremflickr.com/640/128?lock=5048803172286464"`; +exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/dhxs2/1048/128"`; -exports[`image > 1337 > url > with width 1`] = `"https://loremflickr.com/128/480?lock=5048803172286464"`; +exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/dhxs2/128/1048"`; exports[`image > 1337 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=5048803172286464"`; -exports[`image > 1337 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/640/480?lock=2360108468142080"`; +exports[`image > 1337 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/1048/2242?lock=1429298200182784"`; exports[`image > 1337 > urlLoremFlickr > with all options 1`] = `"https://loremflickr.com/128/128/cats?lock=2360108468142080"`; -exports[`image > 1337 > urlLoremFlickr > with category 1`] = `"https://loremflickr.com/640/480/cats?lock=2360108468142080"`; +exports[`image > 1337 > urlLoremFlickr > with category 1`] = `"https://loremflickr.com/1048/2242/cats?lock=1429298200182784"`; -exports[`image > 1337 > urlLoremFlickr > with height 1`] = `"https://loremflickr.com/640/128?lock=2360108468142080"`; +exports[`image > 1337 > urlLoremFlickr > with height 1`] = `"https://loremflickr.com/1048/128?lock=5048803172286464"`; -exports[`image > 1337 > urlLoremFlickr > with width 1`] = `"https://loremflickr.com/128/480?lock=2360108468142080"`; +exports[`image > 1337 > urlLoremFlickr > with width 1`] = `"https://loremflickr.com/128/1048?lock=5048803172286464"`; exports[`image > 1337 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=2360108468142080"`; -exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/y9dhxs/640/480"`; +exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242"`; exports[`image > 1337 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/y9dhxs/128/128?grayscale&blur=4"`; -exports[`image > 1337 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/y9dhxs/640/480?blur=6"`; +exports[`image > 1337 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242?blur=6"`; -exports[`image > 1337 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/y9dhxs/640/480?grayscale&blur=3"`; +exports[`image > 1337 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242?grayscale&blur=3"`; -exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/y9dhxs/640/128"`; +exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/9dhxs2je/1048/128"`; -exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/y9dhxs/128/480"`; +exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/9dhxs2je/128/1048"`; exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/y9dhxs/128/128"`; From 24a966a1a90bebacbe8c83f752f03fedfec6f956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:37:21 -0300 Subject: [PATCH 2/9] fix(image): fix jsdoc --- src/modules/image/index.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index a1e0e143abc..78ccb906d89 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -102,8 +102,8 @@ export class ImageModule { * Generates a random image url. * * @param options Options for generating a URL for an image. - * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. - * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. + * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * * @example * faker.image.url() // 'https://loremflickr.com/640/480?lock=1234' @@ -115,13 +115,13 @@ export class ImageModule { /** * The width of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ height?: number; } = {} @@ -143,8 +143,8 @@ export class ImageModule { * Generates a random image url provided via https://loremflickr.com. * * @param options Options for generating a URL for an image. - * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. - * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. + * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.category Category to use for the image. * * @example @@ -160,13 +160,13 @@ export class ImageModule { /** * The width of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ height?: number; /** @@ -190,8 +190,8 @@ export class ImageModule { * Generates a random image url provided via https://picsum.photos. * * @param options Options for generating a URL for an image. - * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. - * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. + * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.grayscale Whether the image should be grayscale. Defaults to `false`. * @param options.blur Whether the image should be blurred. Defaults to `false`. * @@ -210,13 +210,13 @@ export class ImageModule { /** * The width of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ height?: number; /** @@ -363,8 +363,8 @@ export class ImageModule { * Generates a random data uri containing an URL-encoded SVG image or a Base64-encoded SVG image. * * @param options Options for generating a data uri. - * @param options.width The width of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. - * @param options.height The height of the image. Defaults to `this.faker.number.int({ min: 1, max: 3999 })`. + * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. + * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.color The color of the image. Must be a color supported by svg. Defaults to a random color. * @param options.type The type of the image. Defaults to `'svg-uri'`. * @@ -379,13 +379,13 @@ export class ImageModule { /** * The width of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ width?: number; /** * The height of the image. * - * @default this.faker.number.int({ min: 1, max: 3999 }) + * @default faker.number.int({ min: 1, max: 3999 }) */ height?: number; /** From 8dadeeaa04823619a84862cfd299a09f5af5095a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Thu, 12 Oct 2023 17:58:45 -0300 Subject: [PATCH 3/9] refactor(image): randomize more options --- src/modules/image/index.ts | 21 +++--- test/modules/__snapshots__/image.spec.ts.snap | 74 +++++++++---------- 2 files changed, 49 insertions(+), 46 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index 78ccb906d89..cf9e012ef68 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -192,8 +192,8 @@ export class ImageModule { * @param options Options for generating a URL for an image. * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. - * @param options.grayscale Whether the image should be grayscale. Defaults to `false`. - * @param options.blur Whether the image should be blurred. Defaults to `false`. + * @param options.grayscale Whether the image should be grayscale. Defaults to a random boolean value. + * @param options.blur Whether the image should be blurred. Defaults to a random selection between `false` and a random integer from `1` to `10`. * * @example * faker.image.urlPicsumPhotos() // 'https://picsum.photos/seed/NWbJM2B/640/480' @@ -222,13 +222,13 @@ export class ImageModule { /** * Whether the image should be grayscale. * - * @default false + * @default faker.datatype.boolean() */ grayscale?: boolean; /** * Whether the image should be blurred. * - * @default false + * @default faker.helpers.arrayElements([false, this.faker.number.int({ min: 1, max: 10 })]) */ blur?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; } = {} @@ -236,8 +236,11 @@ export class ImageModule { const { width = this.faker.number.int({ min: 1, max: 3999 }), height = this.faker.number.int({ min: 1, max: 3999 }), - grayscale = false, - blur, + grayscale = this.faker.datatype.boolean(), + blur = this.faker.helpers.arrayElements([ + false, + this.faker.number.int({ min: 1, max: 10 }), + ]), } = options; let url = `https://picsum.photos/seed/${this.faker.string.alphanumeric({ @@ -366,7 +369,7 @@ export class ImageModule { * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.color The color of the image. Must be a color supported by svg. Defaults to a random color. - * @param options.type The type of the image. Defaults to `'svg-uri'`. + * @param options.type The type of the image. Defaults to a random type. * * @example * faker.image.dataUri() // 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http...' @@ -398,7 +401,7 @@ export class ImageModule { * The type of the image to return. Consisting of * the file extension and the used encoding. * - * @default 'svg-uri' + * @default faker.helpers.arrayElements(['svg-uri', 'svg-base64']) */ type?: 'svg-uri' | 'svg-base64'; } = {} @@ -407,7 +410,7 @@ export class ImageModule { width = this.faker.number.int({ min: 1, max: 3999 }), height = this.faker.number.int({ min: 1, max: 3999 }), color = this.faker.color.rgb(), - type = 'svg-uri', + type = this.faker.helpers.arrayElements(['svg-uri', 'svg-base64']), } = options; const svgString = ` 42 > avatarLegacy 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/468.jpg"`; -exports[`image > 42 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221498%22%20height%3D%223186%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23e4abdd%22%2F%3E%3Ctext%20x%3D%22749%22%20y%3D%221593%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1498x3186%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > noArgs 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxNDk4IiBoZWlnaHQ9IjMxODYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNlNGFiZGQiLz48dGV4dCB4PSI3NDkiIHk9IjE1OTMiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTQ5OHgzMTg2PC90ZXh0Pjwvc3ZnPg=="`; exports[`image > 42 > dataUri > with all options+base64 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzMzciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiM2NDMyMTgiLz48dGV4dCB4PSIxIiB5PSI2NjguNSIgZm9udC1zaXplPSIyMCIgYWxpZ25tZW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4yeDEzMzc8L3RleHQ+PC9zdmc+"`; exports[`image > 42 > dataUri > with all options+uri 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%2242%22%20height%3D%22314%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%2221%22%20y%3D%22157%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E42x314%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 42 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221498%22%20height%3D%223186%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22749%22%20y%3D%221593%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1498x3186%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with color 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxNDk4IiBoZWlnaHQ9IjMxODYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9ImJsdWUiLz48dGV4dCB4PSI3NDkiIHk9IjE1OTMiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTQ5OHgzMTg2PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 42 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221498%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23be4abd%22%2F%3E%3Ctext%20x%3D%22749%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1498x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxNDk4IiBoZWlnaHQ9IjEyOCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2JlNGFiZCIvPjx0ZXh0IHg9Ijc0OSIgeT0iNjQiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTQ5OHgxMjg8L3RleHQ+PC9zdmc+"`; exports[`image > 42 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxNDk4IiBoZWlnaHQ9IjMxODYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNlNGFiZGQiLz48dGV4dCB4PSI3NDkiIHk9IjE1OTMiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTQ5OHgzMTg2PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%221498%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23be4abd%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22749%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x1498%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTQ5OCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2JlNGFiZCIvPjx0ZXh0IHg9IjY0IiB5PSI3NDkiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTI4eDE0OTg8L3RleHQ+PC9zdmc+"`; -exports[`image > 42 > dataUri > with width and height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%238be4ab%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 42 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjOGJlNGFiIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/JMBB9r/1498/3186"`; +exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/9r963sRk/1498/3186?grayscale"`; -exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/128"`; +exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/B9r963sR/1498/128"`; -exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/bJMBB9r963/128/1498"`; +exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/B9r963sR/128/1498"`; exports[`image > 42 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=7174621373661184"`; @@ -42,19 +42,19 @@ exports[`image > 42 > urlLoremFlickr > with width 1`] = `"https://loremflickr.co exports[`image > 42 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=3373557438480384"`; -exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186"`; +exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/B9r963sR/1498/3186"`; exports[`image > 42 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/NWbJMBB/128/128?grayscale&blur=4"`; -exports[`image > 42 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186?blur=6"`; +exports[`image > 42 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/JMBB9r/1498/3186?blur=6"`; exports[`image > 42 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186?grayscale&blur=3"`; -exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/WbJMBB9r9/1498/128"`; +exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/128"`; -exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/WbJMBB9r9/128/1498"`; +exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/BB9r963sR/128/1498"`; -exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/NWbJMBB/128/128"`; +exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/MBB9r963s/128/128?grayscale"`; exports[`image > 42 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/1498x3186/e4abdd/39321a.webp?text=concido%20paulatim%20aranea"`; @@ -82,29 +82,29 @@ exports[`image > 1211 > avatarGitHub 1`] = `"https://avatars.githubusercontent.c exports[`image > 1211 > avatarLegacy 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1160.jpg"`; -exports[`image > 1211 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%223714%22%20height%3D%221836%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23db42f0%22%2F%3E%3Ctext%20x%3D%221857%22%20y%3D%22918%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E3714x1836%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > noArgs 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIzNzE0IiBoZWlnaHQ9IjE4MzYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNkYjQyZjAiLz48dGV4dCB4PSIxODU3IiB5PSI5MTgiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MzcxNHgxODM2PC90ZXh0Pjwvc3ZnPg=="`; exports[`image > 1211 > dataUri > with all options+base64 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzMzciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiM2NDMyMTgiLz48dGV4dCB4PSIxIiB5PSI2NjguNSIgZm9udC1zaXplPSIyMCIgYWxpZ25tZW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4yeDEzMzc8L3RleHQ+PC9zdmc+"`; exports[`image > 1211 > dataUri > with all options+uri 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%2242%22%20height%3D%22314%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%2221%22%20y%3D%22157%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E42x314%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1211 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%223714%22%20height%3D%221836%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%221857%22%20y%3D%22918%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E3714x1836%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with color 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIzNzE0IiBoZWlnaHQ9IjE4MzYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9ImJsdWUiLz48dGV4dCB4PSIxODU3IiB5PSI5MTgiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MzcxNHgxODM2PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1211 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%223714%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23adb42f%22%2F%3E%3Ctext%20x%3D%221857%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E3714x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIzNzE0IiBoZWlnaHQ9IjEyOCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2FkYjQyZiIvPjx0ZXh0IHg9IjE4NTciIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjM3MTR4MTI4PC90ZXh0Pjwvc3ZnPg=="`; exports[`image > 1211 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIzNzE0IiBoZWlnaHQ9IjE4MzYiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNkYjQyZjAiLz48dGV4dCB4PSIxODU3IiB5PSI5MTgiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MzcxNHgxODM2PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%223714%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23adb42f%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%221857%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x3714%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMzcxNCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2FkYjQyZiIvPjx0ZXh0IHg9IjY0IiB5PSIxODU3IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgzNzE0PC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1211 > dataUri > with width and height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23eadb42%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1211 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZWFkYjQyIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/1836"`; +exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/F9GdL/3714/1836"`; exports[`image > 1211 > url > with height 1`] = `"https://loremflickr.com/3714/128?lock=8047677172350976"`; exports[`image > 1211 > url > with width 1`] = `"https://loremflickr.com/128/3714?lock=8047677172350976"`; -exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/TMd8Z2F/128/128"`; +exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/Z2F9G/128/128?grayscale"`; exports[`image > 1211 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/3714/1836?lock=8047677172350976"`; @@ -118,19 +118,19 @@ exports[`image > 1211 > urlLoremFlickr > with width 1`] = `"https://loremflickr. exports[`image > 1211 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=8363366036799488"`; -exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836"`; +exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/2F9GdLqlaH/3714/1836"`; exports[`image > 1211 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/128?grayscale&blur=4"`; -exports[`image > 1211 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836?blur=6"`; +exports[`image > 1211 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/1836?blur=6"`; exports[`image > 1211 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836?grayscale&blur=3"`; -exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/TMd8Z2F/3714/128"`; +exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/Z2F9G/3714/128?grayscale"`; -exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/TMd8Z2F/128/3714"`; +exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/Z2F9G/128/3714?grayscale"`; -exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/128"`; +exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/8Z2F9G/128/128"`; exports[`image > 1211 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/3714x1836/db42f0/e3f4a9.jpeg?text=ascit%20suasoria%20tamisium"`; @@ -158,27 +158,27 @@ exports[`image > 1337 > avatarGitHub 1`] = `"https://avatars.githubusercontent.c exports[`image > 1337 > avatarLegacy 1`] = `"https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/327.jpg"`; -exports[`image > 1337 > dataUri > noArgs 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221048%22%20height%3D%222242%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23346ba0%22%2F%3E%3Ctext%20x%3D%22524%22%20y%3D%221121%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1048x2242%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > noArgs 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMDQ4IiBoZWlnaHQ9IjIyNDIiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiMzNDZiYTAiLz48dGV4dCB4PSI1MjQiIHk9IjExMjEiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTA0OHgyMjQyPC90ZXh0Pjwvc3ZnPg=="`; exports[`image > 1337 > dataUri > with all options+base64 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIyIiBoZWlnaHQ9IjEzMzciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiM2NDMyMTgiLz48dGV4dCB4PSIxIiB5PSI2NjguNSIgZm9udC1zaXplPSIyMCIgYWxpZ25tZW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4yeDEzMzc8L3RleHQ+PC9zdmc+"`; exports[`image > 1337 > dataUri > with all options+uri 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%2242%22%20height%3D%22314%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%2221%22%20y%3D%22157%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E42x314%3C%2Ftext%3E%3C%2Fsvg%3E"`; -exports[`image > 1337 > dataUri > with color 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221048%22%20height%3D%222242%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22blue%22%2F%3E%3Ctext%20x%3D%22524%22%20y%3D%221121%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1048x2242%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with color 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMDQ4IiBoZWlnaHQ9IjIyNDIiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9ImJsdWUiLz48dGV4dCB4PSI1MjQiIHk9IjExMjEiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTA0OHgyMjQyPC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1337 > dataUri > with height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%221048%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23c346ba%22%2F%3E%3Ctext%20x%3D%22524%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E1048x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMDQ4IiBoZWlnaHQ9IjEyOCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2MzNDZiYSIvPjx0ZXh0IHg9IjUyNCIgeT0iNjQiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTA0OHgxMjg8L3RleHQ+PC9zdmc+"`; exports[`image > 1337 > dataUri > with type 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMDQ4IiBoZWlnaHQ9IjIyNDIiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiMzNDZiYTAiLz48dGV4dCB4PSI1MjQiIHk9IjExMjEiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTA0OHgyMjQyPC90ZXh0Pjwvc3ZnPg=="`; -exports[`image > 1337 > dataUri > with width 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%221048%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%23c346ba%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%22524%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x1048%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with width 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTA0OCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2MzNDZiYSIvPjx0ZXh0IHg9IjY0IiB5PSI1MjQiIGZvbnQtc2l6ZT0iMjAiIGFsaWdubWVudC1iYXNlbGluZT0ibWlkZGxlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSJ3aGl0ZSI+MTI4eDEwNDg8L3RleHQ+PC9zdmc+"`; -exports[`image > 1337 > dataUri > with width and height 1`] = `"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22%235c346b%22%2F%3E%3Ctext%20x%3D%2264%22%20y%3D%2264%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E128x128%3C%2Ftext%3E%3C%2Fsvg%3E"`; +exports[`image > 1337 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjNWMzNDZiIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; exports[`image > 1337 > url > noArgs 1`] = `"https://loremflickr.com/1048/2242?lock=1914819313664000"`; -exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/dhxs2/1048/128"`; +exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/2jewAgk/1048/128?grayscale"`; -exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/dhxs2/128/1048"`; +exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/2jewAgk/128/1048?grayscale"`; exports[`image > 1337 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=5048803172286464"`; @@ -194,19 +194,19 @@ exports[`image > 1337 > urlLoremFlickr > with width 1`] = `"https://loremflickr. exports[`image > 1337 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=2360108468142080"`; -exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242"`; +exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/2jewAgk/1048/2242?grayscale"`; exports[`image > 1337 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/y9dhxs/128/128?grayscale&blur=4"`; -exports[`image > 1337 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242?blur=6"`; +exports[`image > 1337 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/seed/hxs2je/1048/2242?grayscale&blur=6"`; exports[`image > 1337 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242?grayscale&blur=3"`; -exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/9dhxs2je/1048/128"`; +exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/s2jewAgk/1048/128"`; -exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/9dhxs2je/128/1048"`; +exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/s2jewAgk/128/1048"`; -exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/y9dhxs/128/128"`; +exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/xs2jew/128/128?grayscale"`; exports[`image > 1337 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/1048x2242/346ba0/75bd57.webp?text=cerno%20tabella%20cohors"`; From bd95e4ea6fc57346a56d1a996c341a410c16b328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Thu, 12 Oct 2023 23:14:18 -0300 Subject: [PATCH 4/9] refactor(image): use `faker.helpers.maybe` --- src/modules/image/index.ts | 11 +++--- test/modules/__snapshots__/image.spec.ts.snap | 38 +++++++++---------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index cf9e012ef68..b317de90fa6 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -193,7 +193,7 @@ export class ImageModule { * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.grayscale Whether the image should be grayscale. Defaults to a random boolean value. - * @param options.blur Whether the image should be blurred. Defaults to a random selection between `false` and a random integer from `1` to `10`. + * @param options.blur Whether the image should be blurred. Defaults to a random integer from `1` to `10` or `undefined`. * * @example * faker.image.urlPicsumPhotos() // 'https://picsum.photos/seed/NWbJM2B/640/480' @@ -228,7 +228,7 @@ export class ImageModule { /** * Whether the image should be blurred. * - * @default faker.helpers.arrayElements([false, this.faker.number.int({ min: 1, max: 10 })]) + * @default faker.helpers.maybe(() => faker.number.int({ min: 1, max: 10 })) */ blur?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; } = {} @@ -237,10 +237,9 @@ export class ImageModule { width = this.faker.number.int({ min: 1, max: 3999 }), height = this.faker.number.int({ min: 1, max: 3999 }), grayscale = this.faker.datatype.boolean(), - blur = this.faker.helpers.arrayElements([ - false, - this.faker.number.int({ min: 1, max: 10 }), - ]), + blur = this.faker.helpers.maybe(() => + this.faker.number.int({ min: 1, max: 10 }) + ), } = options; let url = `https://picsum.photos/seed/${this.faker.string.alphanumeric({ diff --git a/test/modules/__snapshots__/image.spec.ts.snap b/test/modules/__snapshots__/image.spec.ts.snap index 5633d6904a7..aeefbbc1521 100644 --- a/test/modules/__snapshots__/image.spec.ts.snap +++ b/test/modules/__snapshots__/image.spec.ts.snap @@ -22,11 +22,11 @@ exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;base64,PHN exports[`image > 42 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjOGJlNGFiIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/9r963sRk/1498/3186?grayscale"`; +exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/3186?grayscale"`; -exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/B9r963sR/1498/128"`; +exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/128?blur=8"`; -exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/B9r963sR/128/1498"`; +exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/BB9r963sR/128/1498?blur=8"`; exports[`image > 42 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=7174621373661184"`; @@ -42,7 +42,7 @@ exports[`image > 42 > urlLoremFlickr > with width 1`] = `"https://loremflickr.co exports[`image > 42 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=3373557438480384"`; -exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/B9r963sR/1498/3186"`; +exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/3186?blur=8"`; exports[`image > 42 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/NWbJMBB/128/128?grayscale&blur=4"`; @@ -50,11 +50,11 @@ exports[`image > 42 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/ exports[`image > 42 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186?grayscale&blur=3"`; -exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/128"`; +exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/JMBB9r/1498/128"`; -exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/BB9r963sR/128/1498"`; +exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/JMBB9r/128/1498"`; -exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/MBB9r963s/128/128?grayscale"`; +exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/bJMBB9r963/128/128?grayscale"`; exports[`image > 42 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/1498x3186/e4abdd/39321a.webp?text=concido%20paulatim%20aranea"`; @@ -98,13 +98,13 @@ exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;base64,P exports[`image > 1211 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZWFkYjQyIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/F9GdL/3714/1836"`; +exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/2F9GdLqlaH/3714/1836?blur=2"`; exports[`image > 1211 > url > with height 1`] = `"https://loremflickr.com/3714/128?lock=8047677172350976"`; exports[`image > 1211 > url > with width 1`] = `"https://loremflickr.com/128/3714?lock=8047677172350976"`; -exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/Z2F9G/128/128?grayscale"`; +exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/128?grayscale"`; exports[`image > 1211 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/3714/1836?lock=8047677172350976"`; @@ -118,7 +118,7 @@ exports[`image > 1211 > urlLoremFlickr > with width 1`] = `"https://loremflickr. exports[`image > 1211 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=8363366036799488"`; -exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/2F9GdLqlaH/3714/1836"`; +exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/8Z2F9G/3714/1836"`; exports[`image > 1211 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/128?grayscale&blur=4"`; @@ -126,11 +126,11 @@ exports[`image > 1211 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photo exports[`image > 1211 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836?grayscale&blur=3"`; -exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/Z2F9G/3714/128?grayscale"`; +exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/128?grayscale"`; -exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/Z2F9G/128/3714?grayscale"`; +exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/3714?grayscale"`; -exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/8Z2F9G/128/128"`; +exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/128?blur=9"`; exports[`image > 1211 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/3714x1836/db42f0/e3f4a9.jpeg?text=ascit%20suasoria%20tamisium"`; @@ -176,9 +176,9 @@ exports[`image > 1337 > dataUri > with width and height 1`] = `"data:image/svg+x exports[`image > 1337 > url > noArgs 1`] = `"https://loremflickr.com/1048/2242?lock=1914819313664000"`; -exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/2jewAgk/1048/128?grayscale"`; +exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/s2jewAgk/1048/128?grayscale&blur=3"`; -exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/2jewAgk/128/1048?grayscale"`; +exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/s2jewAgk/128/1048?grayscale&blur=3"`; exports[`image > 1337 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=5048803172286464"`; @@ -194,7 +194,7 @@ exports[`image > 1337 > urlLoremFlickr > with width 1`] = `"https://loremflickr. exports[`image > 1337 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=2360108468142080"`; -exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/2jewAgk/1048/2242?grayscale"`; +exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/s2jewAgk/1048/2242?grayscale&blur=3"`; exports[`image > 1337 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/y9dhxs/128/128?grayscale&blur=4"`; @@ -202,11 +202,11 @@ exports[`image > 1337 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photo exports[`image > 1337 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242?grayscale&blur=3"`; -exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/s2jewAgk/1048/128"`; +exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/xs2jew/1048/128?blur=3"`; -exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/s2jewAgk/128/1048"`; +exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/xs2jew/128/1048?blur=3"`; -exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/xs2jew/128/128?grayscale"`; +exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/dhxs2/128/128?grayscale"`; exports[`image > 1337 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/1048x2242/346ba0/75bd57.webp?text=cerno%20tabella%20cohors"`; From 3df7f05e77c9186a91859afdafe7a5df9c0c5c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:55:51 -0300 Subject: [PATCH 5/9] refactor(image): allow `0` to disable blur, update test We are allowing the zero value to simplify the default value --- src/modules/image/index.ts | 10 ++--- test/modules/__snapshots__/image.spec.ts.snap | 38 +++++++++---------- test/modules/image.spec.ts | 2 +- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index b317de90fa6..76f920f2764 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -193,7 +193,7 @@ export class ImageModule { * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.grayscale Whether the image should be grayscale. Defaults to a random boolean value. - * @param options.blur Whether the image should be blurred. Defaults to a random integer from `1` to `10` or `undefined`. + * @param options.blur Whether the image should be blurred. Defaults to a random integer from `0` to `10`. * * @example * faker.image.urlPicsumPhotos() // 'https://picsum.photos/seed/NWbJM2B/640/480' @@ -228,18 +228,16 @@ export class ImageModule { /** * Whether the image should be blurred. * - * @default faker.helpers.maybe(() => faker.number.int({ min: 1, max: 10 })) + * @default faker.number.int({ max: 10 }) */ - blur?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; + blur?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; } = {} ): string { const { width = this.faker.number.int({ min: 1, max: 3999 }), height = this.faker.number.int({ min: 1, max: 3999 }), grayscale = this.faker.datatype.boolean(), - blur = this.faker.helpers.maybe(() => - this.faker.number.int({ min: 1, max: 10 }) - ), + blur = this.faker.number.int({ max: 10 }), } = options; let url = `https://picsum.photos/seed/${this.faker.string.alphanumeric({ diff --git a/test/modules/__snapshots__/image.spec.ts.snap b/test/modules/__snapshots__/image.spec.ts.snap index aeefbbc1521..9f05ce609f6 100644 --- a/test/modules/__snapshots__/image.spec.ts.snap +++ b/test/modules/__snapshots__/image.spec.ts.snap @@ -22,11 +22,11 @@ exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;base64,PHN exports[`image > 42 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjOGJlNGFiIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/3186?grayscale"`; +exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/3186?grayscale&blur=8"`; -exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/128?blur=8"`; +exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/MBB9r963s/1498/128?blur=2"`; -exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/BB9r963sR/128/1498?blur=8"`; +exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/MBB9r963s/128/1498?blur=2"`; exports[`image > 42 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=7174621373661184"`; @@ -42,7 +42,7 @@ exports[`image > 42 > urlLoremFlickr > with width 1`] = `"https://loremflickr.co exports[`image > 42 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=3373557438480384"`; -exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/3186?blur=8"`; +exports[`image > 42 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/MBB9r963s/1498/3186?blur=2"`; exports[`image > 42 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/NWbJMBB/128/128?grayscale&blur=4"`; @@ -50,11 +50,11 @@ exports[`image > 42 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photos/ exports[`image > 42 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/3186?grayscale&blur=3"`; -exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/JMBB9r/1498/128"`; +exports[`image > 42 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/JMBB9r/1498/128?blur=10"`; -exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/JMBB9r/128/1498"`; +exports[`image > 42 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/JMBB9r/128/1498?blur=10"`; -exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/bJMBB9r963/128/128?grayscale"`; +exports[`image > 42 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/bJMBB9r963/128/128?grayscale&blur=8"`; exports[`image > 42 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/1498x3186/e4abdd/39321a.webp?text=concido%20paulatim%20aranea"`; @@ -98,13 +98,13 @@ exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;base64,P exports[`image > 1211 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZWFkYjQyIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/2F9GdLqlaH/3714/1836?blur=2"`; +exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/Z2F9G/3714/1836?blur=2"`; exports[`image > 1211 > url > with height 1`] = `"https://loremflickr.com/3714/128?lock=8047677172350976"`; exports[`image > 1211 > url > with width 1`] = `"https://loremflickr.com/128/3714?lock=8047677172350976"`; -exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/128?grayscale"`; +exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/128?grayscale&blur=9"`; exports[`image > 1211 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/3714/1836?lock=8047677172350976"`; @@ -118,7 +118,7 @@ exports[`image > 1211 > urlLoremFlickr > with width 1`] = `"https://loremflickr. exports[`image > 1211 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=8363366036799488"`; -exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/8Z2F9G/3714/1836"`; +exports[`image > 1211 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/8Z2F9G/3714/1836?blur=8"`; exports[`image > 1211 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/sTMd8Z2F9G/128/128?grayscale&blur=4"`; @@ -126,11 +126,11 @@ exports[`image > 1211 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photo exports[`image > 1211 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/3714/1836?grayscale&blur=3"`; -exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/128?grayscale"`; +exports[`image > 1211 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/128?grayscale&blur=9"`; -exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/3714?grayscale"`; +exports[`image > 1211 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/3714?grayscale&blur=9"`; -exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/128?blur=9"`; +exports[`image > 1211 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/Md8Z2F9GdL/128/128?blur=5"`; exports[`image > 1211 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/3714x1836/db42f0/e3f4a9.jpeg?text=ascit%20suasoria%20tamisium"`; @@ -176,9 +176,9 @@ exports[`image > 1337 > dataUri > with width and height 1`] = `"data:image/svg+x exports[`image > 1337 > url > noArgs 1`] = `"https://loremflickr.com/1048/2242?lock=1914819313664000"`; -exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/s2jewAgk/1048/128?grayscale&blur=3"`; +exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/xs2jew/1048/128?grayscale&blur=2"`; -exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/s2jewAgk/128/1048?grayscale&blur=3"`; +exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/xs2jew/128/1048?grayscale&blur=2"`; exports[`image > 1337 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=5048803172286464"`; @@ -194,7 +194,7 @@ exports[`image > 1337 > urlLoremFlickr > with width 1`] = `"https://loremflickr. exports[`image > 1337 > urlLoremFlickr > with width and height 1`] = `"https://loremflickr.com/128/128?lock=2360108468142080"`; -exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/s2jewAgk/1048/2242?grayscale&blur=3"`; +exports[`image > 1337 > urlPicsumPhotos > noArgs 1`] = `"https://picsum.photos/seed/xs2jew/1048/2242?grayscale&blur=2"`; exports[`image > 1337 > urlPicsumPhotos > with all options 1`] = `"https://picsum.photos/seed/y9dhxs/128/128?grayscale&blur=4"`; @@ -202,11 +202,11 @@ exports[`image > 1337 > urlPicsumPhotos > with blur 1`] = `"https://picsum.photo exports[`image > 1337 > urlPicsumPhotos > with blur and grayscale 1`] = `"https://picsum.photos/seed/dhxs2/1048/2242?grayscale&blur=3"`; -exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/xs2jew/1048/128?blur=3"`; +exports[`image > 1337 > urlPicsumPhotos > with height 1`] = `"https://picsum.photos/seed/hxs2je/1048/128?blur=1"`; -exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/xs2jew/128/1048?blur=3"`; +exports[`image > 1337 > urlPicsumPhotos > with width 1`] = `"https://picsum.photos/seed/hxs2je/128/1048?blur=1"`; -exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/dhxs2/128/128?grayscale"`; +exports[`image > 1337 > urlPicsumPhotos > with width and height 1`] = `"https://picsum.photos/seed/dhxs2/128/128?grayscale&blur=6"`; exports[`image > 1337 > urlPlaceholder > noArgs 1`] = `"https://via.placeholder.com/1048x2242/346ba0/75bd57.webp?text=cerno%20tabella%20cohors"`; diff --git a/test/modules/image.spec.ts b/test/modules/image.spec.ts index d2c0152fa53..bc554e168dd 100644 --- a/test/modules/image.spec.ts +++ b/test/modules/image.spec.ts @@ -474,7 +474,7 @@ describe('image', () => { expect(imageUrl).toBeTypeOf('string'); expect(imageUrl).toMatch( - /^https:\/\/picsum\.photos\/seed\/[0-9a-zA-Z]+\/\d+\/\d+$/ + /^https:\/\/picsum\.photos\/seed\/[0-9a-zA-Z]+\/\d+\/\d+(\?(grayscale&?)?(blur=\d+)?)?$/ ); }); }); From aa887896011657043e109d7c3dc93afa1eae8bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Sat, 14 Oct 2023 08:54:22 -0300 Subject: [PATCH 6/9] chore(image): add note that `0` disables the blur --- src/modules/image/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index 76f920f2764..a4ea2926fab 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -193,7 +193,7 @@ export class ImageModule { * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.grayscale Whether the image should be grayscale. Defaults to a random boolean value. - * @param options.blur Whether the image should be blurred. Defaults to a random integer from `0` to `10`. + * @param options.blur Whether the image should be blurred. Defaults to a random integer from `0` to `10`. `0` disables the blur. * * @example * faker.image.urlPicsumPhotos() // 'https://picsum.photos/seed/NWbJM2B/640/480' @@ -226,7 +226,7 @@ export class ImageModule { */ grayscale?: boolean; /** - * Whether the image should be blurred. + * Whether the image should be blurred. `0` disables the blur. * * @default faker.number.int({ max: 10 }) */ From 453a312f7cda08d1871abdaed9cbd78f2cccc841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Sat, 14 Oct 2023 10:01:22 -0300 Subject: [PATCH 7/9] chore(image): move defaults to last part Co-authored-by: ST-DDT --- src/modules/image/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index a4ea2926fab..4e153a2d727 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -193,7 +193,7 @@ export class ImageModule { * @param options.width The width of the image. Defaults to random integer between `1` and `3999`. * @param options.height The height of the image. Defaults to random integer between `1` and `3999`. * @param options.grayscale Whether the image should be grayscale. Defaults to a random boolean value. - * @param options.blur Whether the image should be blurred. Defaults to a random integer from `0` to `10`. `0` disables the blur. + * @param options.blur Whether the image should be blurred. `0` disables the blur. Defaults to a random integer from `0` to `10`. * * @example * faker.image.urlPicsumPhotos() // 'https://picsum.photos/seed/NWbJM2B/640/480' From 3e059e7f25cf8a232ab4c5f241cbf0042d36a2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:20:33 -0300 Subject: [PATCH 8/9] fix(image): pass values to disable `grayscale` and `blur` on `urlPicsumPhotos` when using `url` --- src/modules/image/index.ts | 3 ++- test/modules/__snapshots__/image.spec.ts.snap | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index d3b532cd8b0..1a26065d943 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -133,7 +133,8 @@ export class ImageModule extends ModuleBase { const urlMethod = this.faker.helpers.arrayElement([ this.urlLoremFlickr, - this.urlPicsumPhotos, + ({ width, height }: { width?: number; height?: number }) => + this.urlPicsumPhotos({ width, height, grayscale: false, blur: 0 }), ]); return urlMethod({ width, height }); diff --git a/test/modules/__snapshots__/image.spec.ts.snap b/test/modules/__snapshots__/image.spec.ts.snap index 9f05ce609f6..a7f478e7273 100644 --- a/test/modules/__snapshots__/image.spec.ts.snap +++ b/test/modules/__snapshots__/image.spec.ts.snap @@ -22,11 +22,11 @@ exports[`image > 42 > dataUri > with width 1`] = `"data:image/svg+xml;base64,PHN exports[`image > 42 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjOGJlNGFiIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/BB9r963sR/1498/3186?grayscale&blur=8"`; +exports[`image > 42 > url > noArgs 1`] = `"https://picsum.photos/seed/JMBB9r/1498/3186"`; -exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/MBB9r963s/1498/128?blur=2"`; +exports[`image > 42 > url > with height 1`] = `"https://picsum.photos/seed/bJMBB9r963/1498/128"`; -exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/MBB9r963s/128/1498?blur=2"`; +exports[`image > 42 > url > with width 1`] = `"https://picsum.photos/seed/bJMBB9r963/128/1498"`; exports[`image > 42 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=7174621373661184"`; @@ -98,13 +98,13 @@ exports[`image > 1211 > dataUri > with width 1`] = `"data:image/svg+xml;base64,P exports[`image > 1211 > dataUri > with width and height 1`] = `"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZWFkYjQyIi8+PHRleHQgeD0iNjQiIHk9IjY0IiBmb250LXNpemU9IjIwIiBhbGlnbm1lbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0id2hpdGUiPjEyOHgxMjg8L3RleHQ+PC9zdmc+"`; -exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/Z2F9G/3714/1836?blur=2"`; +exports[`image > 1211 > url > noArgs 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/3714/1836"`; exports[`image > 1211 > url > with height 1`] = `"https://loremflickr.com/3714/128?lock=8047677172350976"`; exports[`image > 1211 > url > with width 1`] = `"https://loremflickr.com/128/3714?lock=8047677172350976"`; -exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/d8Z2F9GdL/128/128?grayscale&blur=9"`; +exports[`image > 1211 > url > with width and height 1`] = `"https://picsum.photos/seed/TMd8Z2F/128/128"`; exports[`image > 1211 > urlLoremFlickr > noArgs 1`] = `"https://loremflickr.com/3714/1836?lock=8047677172350976"`; @@ -176,9 +176,9 @@ exports[`image > 1337 > dataUri > with width and height 1`] = `"data:image/svg+x exports[`image > 1337 > url > noArgs 1`] = `"https://loremflickr.com/1048/2242?lock=1914819313664000"`; -exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/xs2jew/1048/128?grayscale&blur=2"`; +exports[`image > 1337 > url > with height 1`] = `"https://picsum.photos/seed/dhxs2/1048/128"`; -exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/xs2jew/128/1048?grayscale&blur=2"`; +exports[`image > 1337 > url > with width 1`] = `"https://picsum.photos/seed/dhxs2/128/1048"`; exports[`image > 1337 > url > with width and height 1`] = `"https://loremflickr.com/128/128?lock=5048803172286464"`; From a8892a9a837cc70b0daeb6d1491511d2aa76d97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ol=C3=B3rtegui?= <20072509+olrtg@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:28:09 -0300 Subject: [PATCH 9/9] chore(image): added migration docs --- docs/guide/upgrading_v9/2472.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/guide/upgrading_v9/2472.md diff --git a/docs/guide/upgrading_v9/2472.md b/docs/guide/upgrading_v9/2472.md new file mode 100644 index 00000000000..6b4f2b821ac --- /dev/null +++ b/docs/guide/upgrading_v9/2472.md @@ -0,0 +1,9 @@ +### Images now have random width, height and other options by default + +`faker.image.url()` now returns an image url with a random width and height by default. To obtain the previous behavior, pass `{width: 640, height: 480}`. + +`faker.image.urlLoremFlickr()` now returns an image url with a random width and height by default. To obtain the previous behavior, pass `{width: 640, height: 480}`. + +`faker.image.urlPicsumPhotos()` now returns an image url with a random width and height by default, additionally images may be converted to grayscale and blurred at random. To obtain the previous behavior, pass `{width: 640, height: 480, blur: 0, grayscale: false}` + +`faker.image.dataUri()` now returns an image url with a random width and height by default, additionally the type of the image is now random. To obtain the previous behavior, pass `{width: 640, height: 480, type: 'svg-uri'}`.