aboutsummaryrefslogtreecommitdiff
path: root/lib/image.js
diff options
context:
space:
mode:
authorMarak <[email protected]>2014-09-22 11:20:46 +0200
committerMarak <[email protected]>2014-09-22 11:20:46 +0200
commitdfd9774fbe229a3f30b8fdc348a84671da210b6e (patch)
treee706e1ea6356706bc73ec0574d5a1c49834b8967 /lib/image.js
parente8cf78faedbce9a0ae23363c5fedc56e74173d8b (diff)
downloadfaker-dfd9774fbe229a3f30b8fdc348a84671da210b6e.tar.xz
faker-dfd9774fbe229a3f30b8fdc348a84671da210b6e.zip
[api] [minor] Added default values for more methods. Cleaned up image module. Use a less specific regex for usernames.
Diffstat (limited to 'lib/image.js')
-rw-r--r--lib/image.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/image.js b/lib/image.js
index 522cc672..aa983139 100644
--- a/lib/image.js
+++ b/lib/image.js
@@ -1,8 +1,12 @@
var faker = require('../index');
var image = {
+ image: function () {
+ var categories = ["abstract", "animals", "business", "cats", "city", "food", "nightlife", "fashion", "people", "nature", "sports", "technics", "transport"];
+ return image[faker.random.array_element(categories)]();
+ },
avatar: function () {
- return faker.internet.avatarUri();
+ return faker.internet.avatar();
},
imageUrl: function (width, height, category) {
var width = width || 640;
@@ -14,7 +18,7 @@ var image = {
}
return url;
},
- abstractImage: function (width, height) {
+ abstract: function (width, height) {
return faker.image.imageUrl(width, height, 'abstract');
},
animals: function (width, height) {