Skip to content

Commit 2a49e82

Browse files
authored
fix: replaced placeimg.com on loremflickr.com (#692)
1 parent 877ac76 commit 2a49e82

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

src/image.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ export class Image {
3535
* @param randomize Whether to randomize the image or not. Defaults to `false`.
3636
*
3737
* @example
38-
* faker.image.image() // 'http://placeimg.com/640/480/city'
39-
* faker.image.image(1234, 2345) // 'http://placeimg.com/1234/2345/sports'
40-
* faker.image.image(1234, 2345, true) // 'http://placeimg.com/1234/2345/nature?56789'
38+
* faker.image.image() // 'http://loremflickr.com/640/480/city'
39+
* faker.image.image(1234, 2345) // 'http://loremflickr.com/1234/2345/sports'
40+
* faker.image.image(1234, 2345, true) // 'http://loremflickr.com/1234/2345/nature?56789'
4141
*/
4242
image(width?: number, height?: number, randomize?: boolean): string {
4343
const categories = [
@@ -83,11 +83,11 @@ export class Image {
8383
* @param https When true, return a `https` url. Otherwise, return a `http` url.
8484
*
8585
* @example
86-
* faker.image.imageUrl() // 'http://placeimg.com/640/480'
87-
* faker.image.imageUrl(1234, 2345) // 'http://placeimg.com/1234/2345'
88-
* faker.image.imageUrl(1234, 2345, 'cat') // 'http://placeimg.com/1234/2345/cat'
89-
* faker.image.imageUrl(1234, 2345, 'cat', true) // 'http://placeimg.com/1234/2345/cat?6849'
90-
* faker.image.imageUrl(1234, 2345, 'cat', true, true) // 'https://placeimg.com/1234/2345/cat?56789'
86+
* faker.image.imageUrl() // 'http://loremflickr.com/640/480'
87+
* faker.image.imageUrl(1234, 2345) // 'http://loremflickr.com/1234/2345'
88+
* faker.image.imageUrl(1234, 2345, 'cat') // 'http://loremflickr.com/1234/2345/cat'
89+
* faker.image.imageUrl(1234, 2345, 'cat', true) // 'http://loremflickr.com/1234/2345/cat?6849'
90+
* faker.image.imageUrl(1234, 2345, 'cat', true, true) // 'https://loremflickr.com/1234/2345/cat?56789'
9191
*/
9292
imageUrl(
9393
width?: number,
@@ -102,7 +102,7 @@ export class Image {
102102
if (https === true) {
103103
protocol = 'https://';
104104
}
105-
let url = `${protocol}placeimg.com/${width}/${height}`;
105+
let url = `${protocol}loremflickr.com/${width}/${height}`;
106106
if (category != null) {
107107
url += '/' + category;
108108
}
@@ -122,9 +122,9 @@ export class Image {
122122
* @param randomize Whether to randomize the image or not. Defaults to `false`.
123123
*
124124
* @example
125-
* faker.image.abstract() // 'http://placeimg.com/640/480/abstract'
126-
* faker.image.abstract(1234, 2345) // 'http://placeimg.com/1234/2345/abstract'
127-
* faker.image.abstract(1234, 2345, true) // 'http://placeimg.com/1234/2345/abstract?56789'
125+
* faker.image.abstract() // 'http://loremflickr.com/640/480/abstract'
126+
* faker.image.abstract(1234, 2345) // 'http://loremflickr.com/1234/2345/abstract'
127+
* faker.image.abstract(1234, 2345, true) // 'http://loremflickr.com/1234/2345/abstract?56789'
128128
*/
129129
abstract(width?: number, height?: number, randomize?: boolean): string {
130130
return this.faker.image.imageUrl(width, height, 'abstract', randomize);
@@ -138,9 +138,9 @@ export class Image {
138138
* @param randomize Whether to randomize the image or not. Defaults to `false`.
139139
*
140140
* @example
141-
* faker.image.animals() // 'http://placeimg.com/640/480/animals'
142-
* faker.image.animals(1234, 2345) // 'http://placeimg.com/1234/2345/animals'
143-
* faker.image.animals(1234, 2345, true) // 'http://placeimg.com/1234/2345/animals?56789'
141+
* faker.image.animals() // 'http://loremflickr.com/640/480/animals'
142+
* faker.image.animals(1234, 2345) // 'http://loremflickr.com/1234/2345/animals'
143+
* faker.image.animals(1234, 2345, true) // 'http://loremflickr.com/1234/2345/animals?56789'
144144
*/
145145
animals(width?: number, height?: number, randomize?: boolean): string {
146146
return this.faker.image.imageUrl(width, height, 'animals', randomize);
@@ -154,9 +154,9 @@ export class Image {
154154
* @param randomize Whether to randomize the image or not. Defaults to `false`.
155155
*
156156
* @example
157-
* faker.image.business() // 'http://placeimg.com/640/480/business'
158-
* faker.image.business(1234, 2345) // 'http://placeimg.com/1234/2345/business'
159-
* faker.image.business(1234, 2345, true) // 'http://placeimg.com/1234/2345/business?56789'
157+
* faker.image.business() // 'http://loremflickr.com/640/480/business'
158+
* faker.image.business(1234, 2345) // 'http://loremflickr.com/1234/2345/business'
159+
* faker.image.business(1234, 2345, true) // 'http://loremflickr.com/1234/2345/business?56789'
160160
*/
161161
business(width?: number, height?: number, randomize?: boolean): string {
162162
return this.faker.image.imageUrl(width, height, 'business', randomize);
@@ -170,9 +170,9 @@ export class Image {
170170
* @param randomize Whether to randomize the image or not. Defaults to `false`.
171171
*
172172
* @example
173-
* faker.image.cats() // 'http://placeimg.com/640/480/cats'
174-
* faker.image.cats(1234, 2345) // 'http://placeimg.com/1234/2345/cats'
175-
* faker.image.cats(1234, 2345, true) // 'http://placeimg.com/1234/2345/cats?56789'
173+
* faker.image.cats() // 'http://loremflickr.com/640/480/cats'
174+
* faker.image.cats(1234, 2345) // 'http://loremflickr.com/1234/2345/cats'
175+
* faker.image.cats(1234, 2345, true) // 'http://loremflickr.com/1234/2345/cats?56789'
176176
*/
177177
cats(width?: number, height?: number, randomize?: boolean): string {
178178
return this.faker.image.imageUrl(width, height, 'cats', randomize);
@@ -186,9 +186,9 @@ export class Image {
186186
* @param randomize Whether to randomize the image or not. Defaults to `false`.
187187
*
188188
* @example
189-
* faker.image.city() // 'http://placeimg.com/640/480/city'
190-
* faker.image.city(1234, 2345) // 'http://placeimg.com/1234/2345/city'
191-
* faker.image.city(1234, 2345, true) // 'http://placeimg.com/1234/2345/city?56789'
189+
* faker.image.city() // 'http://loremflickr.com/640/480/city'
190+
* faker.image.city(1234, 2345) // 'http://loremflickr.com/1234/2345/city'
191+
* faker.image.city(1234, 2345, true) // 'http://loremflickr.com/1234/2345/city?56789'
192192
*/
193193
city(width?: number, height?: number, randomize?: boolean): string {
194194
return this.faker.image.imageUrl(width, height, 'city', randomize);
@@ -202,9 +202,9 @@ export class Image {
202202
* @param randomize Whether to randomize the image or not. Defaults to `false`.
203203
*
204204
* @example
205-
* faker.image.food() // 'http://placeimg.com/640/480/food'
206-
* faker.image.food(1234, 2345) // 'http://placeimg.com/1234/2345/food'
207-
* faker.image.food(1234, 2345, true) // 'http://placeimg.com/1234/2345/food?56789'
205+
* faker.image.food() // 'http://loremflickr.com/640/480/food'
206+
* faker.image.food(1234, 2345) // 'http://loremflickr.com/1234/2345/food'
207+
* faker.image.food(1234, 2345, true) // 'http://loremflickr.com/1234/2345/food?56789'
208208
*/
209209
food(width?: number, height?: number, randomize?: boolean): string {
210210
return this.faker.image.imageUrl(width, height, 'food', randomize);
@@ -218,9 +218,9 @@ export class Image {
218218
* @param randomize Whether to randomize the image or not. Defaults to `false`.
219219
*
220220
* @example
221-
* faker.image.nightlife() // 'http://placeimg.com/640/480/nightlife'
222-
* faker.image.nightlife(1234, 2345) // 'http://placeimg.com/1234/2345/nightlife'
223-
* faker.image.nightlife(1234, 2345, true) // 'http://placeimg.com/1234/2345/nightlife?56789'
221+
* faker.image.nightlife() // 'http://loremflickr.com/640/480/nightlife'
222+
* faker.image.nightlife(1234, 2345) // 'http://loremflickr.com/1234/2345/nightlife'
223+
* faker.image.nightlife(1234, 2345, true) // 'http://loremflickr.com/1234/2345/nightlife?56789'
224224
*/
225225
nightlife(width?: number, height?: number, randomize?: boolean): string {
226226
return this.faker.image.imageUrl(width, height, 'nightlife', randomize);
@@ -234,9 +234,9 @@ export class Image {
234234
* @param randomize Whether to randomize the image or not. Defaults to `false`.
235235
*
236236
* @example
237-
* faker.image.fashion() // 'http://placeimg.com/640/480/fashion'
238-
* faker.image.fashion(1234, 2345) // 'http://placeimg.com/1234/2345/fashion'
239-
* faker.image.fashion(1234, 2345, true) // 'http://placeimg.com/1234/2345/fashion?56789'
237+
* faker.image.fashion() // 'http://loremflickr.com/640/480/fashion'
238+
* faker.image.fashion(1234, 2345) // 'http://loremflickr.com/1234/2345/fashion'
239+
* faker.image.fashion(1234, 2345, true) // 'http://loremflickr.com/1234/2345/fashion?56789'
240240
*/
241241
fashion(width?: number, height?: number, randomize?: boolean): string {
242242
return this.faker.image.imageUrl(width, height, 'fashion', randomize);
@@ -250,9 +250,9 @@ export class Image {
250250
* @param randomize Whether to randomize the image or not. Defaults to `false`.
251251
*
252252
* @example
253-
* faker.image.people() // 'http://placeimg.com/640/480/people'
254-
* faker.image.people(1234, 2345) // 'http://placeimg.com/1234/2345/people'
255-
* faker.image.people(1234, 2345, true) // 'http://placeimg.com/1234/2345/people?56789'
253+
* faker.image.people() // 'http://loremflickr.com/640/480/people'
254+
* faker.image.people(1234, 2345) // 'http://loremflickr.com/1234/2345/people'
255+
* faker.image.people(1234, 2345, true) // 'http://loremflickr.com/1234/2345/people?56789'
256256
*/
257257
people(width?: number, height?: number, randomize?: boolean): string {
258258
return this.faker.image.imageUrl(width, height, 'people', randomize);
@@ -266,9 +266,9 @@ export class Image {
266266
* @param randomize Whether to randomize the image or not. Defaults to `false`.
267267
*
268268
* @example
269-
* faker.image.nature() // 'http://placeimg.com/640/480/nature'
270-
* faker.image.nature(1234, 2345) // 'http://placeimg.com/1234/2345/nature'
271-
* faker.image.nature(1234, 2345, true) // 'http://placeimg.com/1234/2345/nature?56789'
269+
* faker.image.nature() // 'http://loremflickr.com/640/480/nature'
270+
* faker.image.nature(1234, 2345) // 'http://loremflickr.com/1234/2345/nature'
271+
* faker.image.nature(1234, 2345, true) // 'http://loremflickr.com/1234/2345/nature?56789'
272272
*/
273273
nature(width?: number, height?: number, randomize?: boolean): string {
274274
return this.faker.image.imageUrl(width, height, 'nature', randomize);
@@ -282,9 +282,9 @@ export class Image {
282282
* @param randomize Whether to randomize the image or not. Defaults to `false`.
283283
*
284284
* @example
285-
* faker.image.sports() // 'http://placeimg.com/640/480/sports'
286-
* faker.image.sports(1234, 2345) // 'http://placeimg.com/1234/2345/sports'
287-
* faker.image.sports(1234, 2345, true) // 'http://placeimg.com/1234/2345/sports?56789'
285+
* faker.image.sports() // 'http://loremflickr.com/640/480/sports'
286+
* faker.image.sports(1234, 2345) // 'http://loremflickr.com/1234/2345/sports'
287+
* faker.image.sports(1234, 2345, true) // 'http://loremflickr.com/1234/2345/sports?56789'
288288
*/
289289
sports(width?: number, height?: number, randomize?: boolean): string {
290290
return this.faker.image.imageUrl(width, height, 'sports', randomize);
@@ -298,9 +298,9 @@ export class Image {
298298
* @param randomize Whether to randomize the image or not. Defaults to `false`.
299299
*
300300
* @example
301-
* faker.image.technics() // 'http://placeimg.com/640/480/technics'
302-
* faker.image.technics(1234, 2345) // 'http://placeimg.com/1234/2345/technics'
303-
* faker.image.technics(1234, 2345, true) // 'http://placeimg.com/1234/2345/technics?56789'
301+
* faker.image.technics() // 'http://loremflickr.com/640/480/technics'
302+
* faker.image.technics(1234, 2345) // 'http://loremflickr.com/1234/2345/technics'
303+
* faker.image.technics(1234, 2345, true) // 'http://loremflickr.com/1234/2345/technics?56789'
304304
*/
305305
technics(width?: number, height?: number, randomize?: boolean): string {
306306
return this.faker.image.imageUrl(width, height, 'technics', randomize);
@@ -314,9 +314,9 @@ export class Image {
314314
* @param randomize Whether to randomize the image or not. Defaults to `false`.
315315
*
316316
* @example
317-
* faker.image.transport() // 'http://placeimg.com/640/480/transport'
318-
* faker.image.transport(1234, 2345) // 'http://placeimg.com/1234/2345/transport'
319-
* faker.image.transport(1234, 2345, true) // 'http://placeimg.com/1234/2345/transport?56789'
317+
* faker.image.transport() // 'http://loremflickr.com/640/480/transport'
318+
* faker.image.transport(1234, 2345) // 'http://loremflickr.com/1234/2345/transport'
319+
* faker.image.transport(1234, 2345, true) // 'http://loremflickr.com/1234/2345/transport?56789'
320320
*/
321321
transport(width?: number, height?: number, randomize?: boolean): string {
322322
return this.faker.image.imageUrl(width, height, 'transport', randomize);

0 commit comments

Comments
 (0)