diff options
| author | Vivek Seth <[email protected]> | 2016-05-05 14:52:29 -0400 |
|---|---|---|
| committer | Vivek Seth <[email protected]> | 2016-05-05 14:52:29 -0400 |
| commit | bec87b1acb708cba7b13173d3e240ce9dfb4bb27 (patch) | |
| tree | 32dff5f643fa46c646e36550fa755788fc092a23 /lib | |
| parent | e8f51dcddd2586fcce12635850a6692b414869ef (diff) | |
| download | faker-bec87b1acb708cba7b13173d3e240ce9dfb4bb27.tar.xz faker-bec87b1acb708cba7b13173d3e240ce9dfb4bb27.zip | |
If no input params return random coordinate
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/address.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/address.js b/lib/address.js index 6d9748fd..684914ce 100644 --- a/lib/address.js +++ b/lib/address.js @@ -133,7 +133,10 @@ var address = { return [radiansToDegrees(lat2), radiansToDegrees(lon2)]; } - location = location || [faker.latitude(), faker.longitude()] + // If there is no coordinate, the best we can do is return a random GPS coordinate. + if (coordinate === undefined) { + return [this.latitude(), this.longitude()] + } radius = radius || 10.0; isMetric = isMetric || false; |
