faker 5.5.1 → 5.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/system.js CHANGED
@@ -43,10 +43,11 @@ function System(faker) {
43
43
  * @method faker.system.fileName
44
44
  */
45
45
  this.fileName = function () {
46
- var str = faker.random.words() + "." + faker.system.fileExt();
47
- return str
48
- .toLowerCase()
49
- .replace(/\W/g, "_");
46
+ var str = faker.random.words();
47
+ str = str
48
+ .toLowerCase()
49
+ .replace(/\W/g, "_") + "." + faker.system.fileExt();;
50
+ return str;
50
51
  };
51
52
 
52
53
  /**
@@ -56,10 +57,12 @@ function System(faker) {
56
57
  * @param {string} ext
57
58
  */
58
59
  this.commonFileName = function (ext) {
59
- var str = faker.random.words() + "." + (ext || faker.system.commonFileExt());
60
- return str
61
- .toLowerCase()
62
- .replace(/\W/g, "_");
60
+ var str = faker.random.words();
61
+ str = str
62
+ .toLowerCase()
63
+ .replace(/\W/g, "_");
64
+ str += "." + (ext || faker.system.commonFileExt());
65
+ return str;
63
66
  };
64
67
 
65
68
  /**
@@ -190,7 +193,7 @@ function System(faker) {
190
193
  * @method faker.system.filePath
191
194
  */
192
195
  this.filePath = function () {
193
- return faker.fake("{{system.directoryPath}}/{{system.fileName}}");
196
+ return faker.fake("{{system.directoryPath}}/{{system.fileName}}.{{system.fileExt}}");
194
197
  };
195
198
 
196
199
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "faker",
3
3
  "description": "Generate massive amounts of fake contextual data",
4
- "version": "5.5.1",
4
+ "version": "5.5.2",
5
5
  "contributors": [
6
6
  "Marak Squires <marak.squires@gmail.com>"
7
7
  ],