aboutsummaryrefslogtreecommitdiff
path: root/lib/image.js
diff options
context:
space:
mode:
authorLuiz Strobelt <[email protected]>2020-10-01 00:28:36 -0300
committerGitHub <[email protected]>2020-10-01 00:28:36 -0300
commit5df3678f842383855c53a4c14d39a20deb64f7cc (patch)
tree3b9fb614af27c68cfae7cdf76929069f8935ec0c /lib/image.js
parent27f4878ab3d989cdddec9df99802fe2150730ba2 (diff)
parent91dc8a3372426bc691be56153b33e81a16459f49 (diff)
downloadfaker-5df3678f842383855c53a4c14d39a20deb64f7cc.tar.xz
faker-5df3678f842383855c53a4c14d39a20deb64f7cc.zip
Merge pull request #1 from Marak/master
Update to latest base branch
Diffstat (limited to 'lib/image.js')
-rw-r--r--lib/image.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/image.js b/lib/image.js
index b25b5895..3f50d78f 100644
--- a/lib/image.js
+++ b/lib/image.js
@@ -1,10 +1,17 @@
/**
*
* @namespace faker.image
+ * @property {object} lorempixel - faker.image.lorempixel
+ * @property {object} unsplash - faker.image.unsplash
+ * @property {object} unsplash - faker.image.lorempicsum
+ * @default Default provider is unsplash image provider
*/
var Image = function (faker) {
var self = this;
+ var Lorempixel = require('./image_providers/lorempixel');
+ var Unsplash = require('./image_providers/unsplash');
+ var LoremPicsum = require('./image_providers/lorempicsum');
/**
* image
@@ -42,7 +49,7 @@ var Image = function (faker) {
if (typeof https !== 'undefined' && https === true) {
protocol = 'https://';
}
- var url = protocol + 'lorempixel.com/' + width + '/' + height;
+ var url = protocol + 'placeimg.com/' + width + '/' + height;
if (typeof category !== 'undefined') {
url += '/' + category;
}
@@ -210,6 +217,14 @@ var Image = function (faker) {
var rawPrefix = 'data:image/svg+xml;charset=UTF-8,';
return rawPrefix + encodeURIComponent(svgString);
};
+
+ self.lorempixel = new Lorempixel(faker);
+ self.unsplash = new Unsplash(faker);
+ self.lorempicsum = new LoremPicsum(faker);
+
+ // Object.assign(self, self.unsplash);
+ // How to set default as unsplash? should be image.default?
}
+
module["exports"] = Image;