fake-identity icon indicating copy to clipboard operation
fake-identity copied to clipboard

Add the option for all Number phone numbers

Open jhorwit2 opened this issue 10 years ago • 3 comments

For example, simply return "5554441234" instead of "(555) 444-1234"

If this sounds good I can code it up / make tests and submit a PR.

jhorwit2 avatar Sep 23 '14 13:09 jhorwit2

Sounds good. Eventually, I'd like to be able to pass an options object to generate() with options like phone number format, etc.

travishorn avatar Sep 23 '14 15:09 travishorn

That's what I was thinking when I initially peeked at the code.

I was thinking when you call generate you can pass it an optional config object after the number, which will have phoneNumber options, etc.

Is that what you had in mind?

generate(config, num);

or 

generate(num, config);

or you can do something like this to clean it up, because if you do one of the ways above you have issues when you want 1 number and a config.

generate() -- default 1 with default config

generate(config);

config = {
  num: Number,
  phoneNumber: String,
  etc,
  etc
};

jhorwit2 avatar Sep 23 '14 16:09 jhorwit2

Ideally, I'd like generate(config, num), and if the first argument is a number instead of an object, it just acts as generate(num).

travishorn avatar Sep 23 '14 18:09 travishorn