diff options
| author | Shinigami <[email protected]> | 2022-01-11 20:06:46 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-11 14:06:46 -0500 |
| commit | d4c295f698ed256cb6c53ea77249e64b544ca8c0 (patch) | |
| tree | db0b9e33d8a5d4ddbb0b8e9a0139955b444f2cbb /lib/git.js | |
| parent | ee666cd2f6cded87b4f4e366e2c661fcd5253a72 (diff) | |
| download | faker-d4c295f698ed256cb6c53ea77249e64b544ca8c0.tar.xz faker-d4c295f698ed256cb6c53ea77249e64b544ca8c0.zip | |
chore: format lib without locales (#66)
Diffstat (limited to 'lib/git.js')
| -rw-r--r-- | lib/git.js | 44 |
1 files changed, 31 insertions, 13 deletions
@@ -2,22 +2,39 @@ * @namespace faker.git */ -var Git = function(faker) { +var Git = function (faker) { var self = this; var f = faker.fake; - var hexChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + var hexChars = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + ]; /** * branch * * @method faker.git.branch */ - self.branch = function() { + self.branch = function () { var noun = faker.hacker.noun().replace(' ', '-'); var verb = faker.hacker.verb().replace(' ', '-'); return noun + '-' + verb; - } + }; /** * commitEntry @@ -25,16 +42,17 @@ var Git = function(faker) { * @method faker.git.commitEntry * @param {object} options */ - self.commitEntry = function(options) { + self.commitEntry = function (options) { options = options || {}; var entry = 'commit {{git.commitSha}}\r\n'; - if (options.merge || (faker.datatype.number({ min: 0, max: 4 }) === 0)) { + if (options.merge || faker.datatype.number({ min: 0, max: 4 }) === 0) { entry += 'Merge: {{git.shortSha}} {{git.shortSha}}\r\n'; } - entry += 'Author: {{name.firstName}} {{name.lastName}} <{{internet.email}}>\r\n'; + entry += + 'Author: {{name.firstName}} {{name.lastName}} <{{internet.email}}>\r\n'; entry += 'Date: ' + faker.date.recent().toString() + '\r\n'; entry += '\r\n\xa0\xa0\xa0\xa0{{git.commitMessage}}\r\n'; @@ -46,7 +64,7 @@ var Git = function(faker) { * * @method faker.git.commitMessage */ - self.commitMessage = function() { + self.commitMessage = function () { var format = '{{hacker.verb}} {{hacker.adjective}} {{hacker.noun}}'; return f(format); }; @@ -56,8 +74,8 @@ var Git = function(faker) { * * @method faker.git.commitSha */ - self.commitSha = function() { - var commit = ""; + self.commitSha = function () { + var commit = ''; for (var i = 0; i < 40; i++) { commit += faker.random.arrayElement(hexChars); @@ -71,8 +89,8 @@ var Git = function(faker) { * * @method faker.git.shortSha */ - self.shortSha = function() { - var shortSha = ""; + self.shortSha = function () { + var shortSha = ''; for (var i = 0; i < 7; i++) { shortSha += faker.random.arrayElement(hexChars); @@ -82,6 +100,6 @@ var Git = function(faker) { }; return self; -} +}; module['exports'] = Git; |
