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/dist/faker.js +73 -30
- package/dist/faker.min.js +1 -1
- package/lib/system.js +12 -9
- package/package.json +1 -1
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()
|
47
|
-
|
48
|
-
|
49
|
-
|
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()
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
/**
|