Skip to content

Commit

Permalink
chore: revert code changes and apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Mar 11, 2022
1 parent 472ace4 commit 522a945
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
11 changes: 7 additions & 4 deletions src/image_providers/lorempicsum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class LoremPicsum {
* faker.internet.avatar()
* // 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/315.jpg'
*/
// TODO ST-DDT 2022-03-11: Deprecate this method as it is duplicate as has nothing to do with lorempicsum.
// TODO ST-DDT 2022-03-11: Deprecate this method as it is duplicate and has nothing to do with lorempicsum.
avatar(): string {
return this.faker.internet.avatar();
}
Expand All @@ -92,12 +92,15 @@ export class LoremPicsum {
* @param seed The optional seed to use.
*/
imageUrl(
width = 640,
height = 480,
grayscale = false,
width?: number,
height?: number,
grayscale?: boolean,
blur?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10,
seed?: string
): string {
width = width || 640;
height = height || 480;

let url = 'https://picsum.photos';

if (seed) {
Expand Down
11 changes: 7 additions & 4 deletions src/image_providers/lorempixel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Lorempixel {
* faker.internet.avatar()
* // 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/315.jpg'
*/
// TODO ST-DDT 2022-03-11: Deprecate this method as it is duplicate as has nothing to do with lorempixel.
// TODO ST-DDT 2022-03-11: Deprecate this method as it is duplicate and has nothing to do with lorempixel.
avatar(): string {
return this.faker.internet.avatar();
}
Expand All @@ -57,11 +57,14 @@ export class Lorempixel {
* @param randomize Whether to append a seed to the url. Defaults to `false`.
*/
imageUrl(
width = 640,
height = 480,
width?: number,
height?: number,
category?: string,
randomize = false
randomize?: boolean
): string {
width = width || 640;
height = height || 480;

let url = `https://lorempixel.com/${width}/${height}`;
if (typeof category !== 'undefined') {
url += '/' + category;
Expand Down
9 changes: 6 additions & 3 deletions src/image_providers/unsplash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Unsplash {
* faker.internet.avatar()
* // 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/315.jpg'
*/
// TODO ST-DDT 2022-03-11: Deprecate this method as it is duplicate as has nothing to do with unsplash.
// TODO ST-DDT 2022-03-11: Deprecate this method as it is duplicate and has nothing to do with unsplash.
avatar(): string {
return this.faker.internet.avatar();
}
Expand All @@ -48,11 +48,14 @@ export class Unsplash {
* @param keyword The image keywords to use.
*/
imageUrl(
width = 640,
height = 480,
width?: number,
height?: number,
category?: string,
keyword?: string
): string {
width = width || 640;
height = height || 480;

let url = 'https://source.unsplash.com';

if (typeof category !== 'undefined') {
Expand Down

0 comments on commit 522a945

Please sign in to comment.