Skip to content

Commit

Permalink
linting name/phone_number
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanDonovan committed Jan 6, 2013
1 parent 1e7b4b8 commit 9a3606c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
37 changes: 12 additions & 25 deletions lib/name.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
var Helpers = require('./helpers');
var definitions = require('./definitions');

/*
exports.first_name = function(){
return definitions.first_name()[0];
//Math.floor(Math.random()*10);
};
*/

exports.findName = function() {
var r = Helpers.randomNumber(8);
switch(r)
{
case 0:
return Helpers.randomize(definitions.name_prefix()) + " " + Helpers.randomize(definitions.first_name()) + " " + Helpers.randomize(definitions.last_name());
break;
case 1:
return Helpers.randomize(definitions.first_name()) + " " + Helpers.randomize(definitions.last_name()); + " " + Helpers.randomize(definitions.name_suffix);
break;
}

return Helpers.randomize(definitions.first_name()) + " " + Helpers.randomize(definitions.last_name());

exports.findName = function () {
var r = Helpers.randomNumber(8);
switch (r) {
case 0:
return Helpers.randomize(definitions.name_prefix()) + " " + Helpers.randomize(definitions.first_name()) + " " + Helpers.randomize(definitions.last_name());
case 1:
return Helpers.randomize(definitions.first_name()) + " " + Helpers.randomize(definitions.last_name()) + " " + Helpers.randomize(definitions.name_suffix);
}

return Helpers.randomize(definitions.first_name()) + " " + Helpers.randomize(definitions.last_name());
};

exports.firstName = function () {
return Helpers.randomize(definitions.first_name());
return Helpers.randomize(definitions.first_name());
};

exports.lastName = function () {
return Helpers.randomize(definitions.last_name());
return Helpers.randomize(definitions.last_name());
};
8 changes: 3 additions & 5 deletions lib/phone_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ var Helpers = require('./helpers');
var definitions = require('./definitions');

exports.phoneNumber = function () {

return Helpers.replaceSymbolWithNumber(Helpers.randomize(definitions.phone_formats()));

return Helpers.replaceSymbolWithNumber(Helpers.randomize(definitions.phone_formats()));
};

exports.phoneNumberFormat = function (format) {
return Helpers.replaceSymbolWithNumber(definitions.phone_formats()[format]);
};
return Helpers.replaceSymbolWithNumber(definitions.phone_formats()[format]);
};

0 comments on commit 9a3606c

Please sign in to comment.