aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLevente Löki <[email protected]>2016-11-24 14:22:59 +0100
committerLevente Löki <[email protected]>2016-11-24 14:22:59 +0100
commitca8eedbba9c3a96f916cd9c6e266329ad0686a91 (patch)
tree02f83d8b653df5b79f7815662476943f7a8538a7 /lib
parent7e96b93869b422af5a63c115e04ff0206bf7b228 (diff)
downloadfaker-ca8eedbba9c3a96f916cd9c6e266329ad0686a91.tar.xz
faker-ca8eedbba9c3a96f916cd9c6e266329ad0686a91.zip
Added lorem.slug method
Diffstat (limited to 'lib')
-rw-r--r--lib/lorem.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/lorem.js b/lib/lorem.js
index 403e0e6d..db6aec72 100644
--- a/lib/lorem.js
+++ b/lib/lorem.js
@@ -51,6 +51,17 @@ var Lorem = function (faker) {
};
/**
+ * slug
+ *
+ * @method faker.lorem.slug
+ * @param {number} wordCount number of words, defaults to 3
+ */
+ self.slug = function (wordCount) {
+ var words = faker.lorem.words(wordCount);
+ return Helpers.slugify(words);
+ };
+
+ /**
* sentences
*
* @method faker.lorem.sentences