randex 0.21.0 → 0.23.0

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.
Files changed (44) hide show
  1. package/README.md +93 -93
  2. package/lib/custom/email.d.ts +0 -3
  3. package/lib/custom/email.js +0 -41
  4. package/lib/custom/filename.d.ts +0 -4
  5. package/lib/custom/filename.js +0 -41
  6. package/lib/custom/fullname.d.ts +0 -5
  7. package/lib/custom/fullname.js +0 -33
  8. package/lib/custom/index.d.ts +41 -5
  9. package/lib/custom/index.js +309 -5
  10. package/lib/custom/number.d.ts +0 -3
  11. package/lib/custom/number.js +0 -37
  12. package/lib/custom/random.d.ts +5 -0
  13. package/lib/custom/random.js +2 -0
  14. package/lib/custom/singleName.d.ts +5 -0
  15. package/lib/custom/singleName.js +2 -0
  16. package/lib/custom/username.d.ts +0 -1
  17. package/lib/custom/username.js +0 -10
  18. package/lib/index.d.ts +3 -1
  19. package/lib/index.js +4 -1
  20. package/lib/test/array-item.test.js +2 -2
  21. package/lib/test/array.test.js +2 -2
  22. package/lib/test/email.test.js +8 -8
  23. package/lib/test/filename.test.js +10 -10
  24. package/lib/test/fullname.test.js +1 -1
  25. package/lib/test/markdown.test.js +34 -35
  26. package/lib/test/name.test.js +10 -10
  27. package/lib/test/number-array.test.js +5 -5
  28. package/lib/test/number.test.js +6 -6
  29. package/lib/test/params.test.js +15 -15
  30. package/lib/test/random.test.js +11 -11
  31. package/lib/test/username.test.js +8 -8
  32. package/package.json +1 -1
  33. package/lib/basic/index.d.ts +0 -2
  34. package/lib/basic/index.js +0 -83
  35. package/lib/custom/array-item.d.ts +0 -2
  36. package/lib/custom/array-item.js +0 -18
  37. package/lib/custom/array.d.ts +0 -1
  38. package/lib/custom/array.js +0 -21
  39. package/lib/custom/bool.d.ts +0 -1
  40. package/lib/custom/bool.js +0 -7
  41. package/lib/custom/name.d.ts +0 -9
  42. package/lib/custom/name.js +0 -30
  43. package/lib/custom/number-array.d.ts +0 -2
  44. package/lib/custom/number-array.js +0 -30
@@ -14,13 +14,317 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Randex = void 0;
18
+ var set_1 = require("../basic/set");
19
+ var type_1 = require("../basic/type");
17
20
  __exportStar(require("./email"), exports);
18
21
  __exportStar(require("./filename"), exports);
19
- __exportStar(require("./name"), exports);
22
+ __exportStar(require("./singleName"), exports);
20
23
  __exportStar(require("./username"), exports);
21
24
  __exportStar(require("./fullname"), exports);
22
25
  __exportStar(require("./number"), exports);
23
- __exportStar(require("./number-array"), exports);
24
- __exportStar(require("./array"), exports);
25
- __exportStar(require("./array-item"), exports);
26
- __exportStar(require("./bool"), exports);
26
+ var Randex = /** @class */ (function () {
27
+ function Randex() {
28
+ }
29
+ // base
30
+ Randex.randomString = function (params) {
31
+ var length = params.length, range = params.range;
32
+ var result = "";
33
+ var currentLength = 0;
34
+ if (typeof length === "number") {
35
+ currentLength = length;
36
+ }
37
+ else if (Array.isArray(length)) {
38
+ var min = length[0], max = length[1];
39
+ currentLength = min + set_1.RandexSetUtil.randomNumber(max - min + 1);
40
+ }
41
+ for (var i = 0; i < currentLength; i++) {
42
+ var index = set_1.RandexSetUtil.randomNumber(range.length - 1);
43
+ if (range.length >= index || range.length <= index) {
44
+ result += range[index];
45
+ }
46
+ }
47
+ return result;
48
+ };
49
+ Randex.toContent = function (options) {
50
+ if (type_1.RandexTypeParser.isSet(options)) {
51
+ return {
52
+ set: options,
53
+ };
54
+ }
55
+ else if (type_1.RandexTypeParser.isPartArray(options)) {
56
+ if (options.length === 2) {
57
+ var set = options[0], rangeOrLength = options[1];
58
+ return type_1.RandexTypeParser.isLength(rangeOrLength)
59
+ ? {
60
+ set: set,
61
+ length: rangeOrLength,
62
+ }
63
+ : {
64
+ set: set,
65
+ range: rangeOrLength,
66
+ };
67
+ }
68
+ else if (options.length === 3) {
69
+ var set = options[0], range = options[1], length_1 = options[2];
70
+ return {
71
+ set: set,
72
+ range: range,
73
+ length: length_1,
74
+ };
75
+ }
76
+ }
77
+ return options;
78
+ };
79
+ Randex.toRangeOptions = function (options) {
80
+ var fullRange = "";
81
+ var set = options.set, range = options.range, _a = options.length, length = _a === void 0 ? 1 : _a;
82
+ if (range) {
83
+ fullRange += range;
84
+ }
85
+ if (set) {
86
+ fullRange += set_1.RandexSetUtil.toRange(set);
87
+ }
88
+ return {
89
+ range: fullRange,
90
+ length: length,
91
+ };
92
+ };
93
+ Randex.random = function () {
94
+ var options = [];
95
+ for (var _i = 0; _i < arguments.length; _i++) {
96
+ options[_i] = arguments[_i];
97
+ }
98
+ var result = "";
99
+ for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {
100
+ var option = options_1[_a];
101
+ var content = Randex.toContent(option);
102
+ var p = Randex.toRangeOptions(content);
103
+ result += Randex.randomString(p);
104
+ }
105
+ return result;
106
+ };
107
+ Randex.arrayItem = function (array, defaultValue) {
108
+ if (array === null || array === void 0 ? void 0 : array.length) {
109
+ var arrayCount = array.length - 1;
110
+ var index = Randex.number(0, arrayCount);
111
+ return array[index];
112
+ }
113
+ else if (defaultValue) {
114
+ return defaultValue;
115
+ }
116
+ else {
117
+ throw "Array is empty";
118
+ }
119
+ };
120
+ Randex.array = function (array, count) {
121
+ var result = [];
122
+ var maxCount = array.length;
123
+ var uniqueArray = [];
124
+ for (var i = 0; i < array.length; i++) {
125
+ uniqueArray.push(array[i]);
126
+ }
127
+ for (var i = 0; i < count && i < maxCount; i++) {
128
+ var arrayCount = uniqueArray.length - 1;
129
+ var index = Randex.number(arrayCount);
130
+ var value = uniqueArray[index];
131
+ result.push(value);
132
+ uniqueArray.splice(index, 1);
133
+ }
134
+ return result;
135
+ };
136
+ Randex.bool = function () {
137
+ return Math.random() < 0.5;
138
+ };
139
+ Randex.email = function (p1, p2, p3) {
140
+ var prefixLength = set_1.RandexSetUtil.defaultEmailPrefixLength;
141
+ var hightDomainLength = set_1.RandexSetUtil.defaultHightDomainEmailLength;
142
+ var lowDomainLength = set_1.RandexSetUtil.defaultLowDomainEmailLength;
143
+ var domain = "";
144
+ if (type_1.RandexTypeParser.isLength(p1)) {
145
+ prefixLength = p1;
146
+ if (type_1.RandexTypeParser.isLength(p2)) {
147
+ lowDomainLength = p2;
148
+ }
149
+ if (type_1.RandexTypeParser.isLength(p3)) {
150
+ hightDomainLength = p3;
151
+ }
152
+ }
153
+ else if (typeof p1 === "string") {
154
+ domain = p1;
155
+ }
156
+ else if (typeof p1 === "object") {
157
+ if (p1.prefixLength) {
158
+ prefixLength = p1.prefixLength;
159
+ }
160
+ if (p1.hightDomainLength) {
161
+ hightDomainLength = p1.hightDomainLength;
162
+ }
163
+ if (p1.lowDomainLength) {
164
+ lowDomainLength = p1.lowDomainLength;
165
+ }
166
+ if (p1.domain) {
167
+ domain = p1.domain;
168
+ }
169
+ }
170
+ if (!domain) {
171
+ domain = Randex.random([["english", "l"], lowDomainLength]) + "." + Randex.random([["english", "l"], hightDomainLength]);
172
+ }
173
+ return Randex.random([[["english", "l"], "number"], prefixLength]) + "@" + domain;
174
+ };
175
+ Randex.fileName = function (p1, p2) {
176
+ var fileNameLength = set_1.RandexSetUtil.defaultFileNameLength;
177
+ var extensionLength = set_1.RandexSetUtil.defaultExtensionLength;
178
+ var extension = "";
179
+ if (type_1.RandexTypeParser.isLength(p1)) {
180
+ fileNameLength = p1;
181
+ if (type_1.RandexTypeParser.isLength(p2)) {
182
+ extensionLength = p2;
183
+ }
184
+ else if (typeof p2 === "string") {
185
+ extension = p2;
186
+ }
187
+ }
188
+ else if (typeof p1 === "string") {
189
+ extension = p1;
190
+ }
191
+ else if (typeof p1 === "object") {
192
+ if (p1.fileNameLength) {
193
+ fileNameLength = p1.fileNameLength;
194
+ }
195
+ if (p1.extensionLength) {
196
+ extensionLength = p1.extensionLength;
197
+ }
198
+ if (p1.extension) {
199
+ extension = p1.extension;
200
+ }
201
+ }
202
+ fileNameLength = set_1.RandexSetUtil.getLength(1, fileNameLength, fileNameLength);
203
+ if (!extension) {
204
+ extension = Randex.random([["english", "l"], extensionLength]);
205
+ }
206
+ return (Randex.random([["english", "number"], set_1.RandexSetUtil.fileNameExtraChars, fileNameLength]) +
207
+ Randex.random(["english", "number"]) +
208
+ "." +
209
+ (extension ? extension.replace(/^\./, "") : Randex.random([["english", "l"], extensionLength])));
210
+ };
211
+ Randex.fullName = function (p1, p2, p3) {
212
+ var firstLength = 0;
213
+ var secondLength = 0;
214
+ var alphabet = "english";
215
+ if (type_1.RandexTypeParser.isLength(p1)) {
216
+ firstLength = secondLength = p1;
217
+ }
218
+ else if (type_1.RandexTypeParser.inAlphabet(p1)) {
219
+ alphabet = p1;
220
+ if (type_1.RandexTypeParser.isLength(p2)) {
221
+ firstLength = secondLength = p2;
222
+ }
223
+ if (type_1.RandexTypeParser.isLength(p3)) {
224
+ secondLength = p3;
225
+ }
226
+ }
227
+ else if (typeof p1 === "object") {
228
+ if (p1.alphabet) {
229
+ alphabet = p1.alphabet;
230
+ }
231
+ if (p1.firstLength) {
232
+ firstLength = p1.firstLength;
233
+ }
234
+ if (p1.secondLength) {
235
+ secondLength = p1.secondLength;
236
+ }
237
+ }
238
+ return Randex.singleName({ length: firstLength, alphabet: alphabet }) + " " + Randex.singleName({ length: secondLength, alphabet: alphabet });
239
+ };
240
+ Randex.singleName = function (p1, p2) {
241
+ var length = 0;
242
+ var alphabet = "english";
243
+ if (type_1.RandexTypeParser.isLength(p1)) {
244
+ length = p1;
245
+ }
246
+ else if (type_1.RandexTypeParser.inAlphabet(p1)) {
247
+ alphabet = p1;
248
+ if (type_1.RandexTypeParser.isLength(p2)) {
249
+ length = p2;
250
+ }
251
+ }
252
+ else if (typeof p1 === "object") {
253
+ if (p1.alphabet) {
254
+ alphabet = p1.alphabet;
255
+ }
256
+ if (p1.length) {
257
+ length = p1.length;
258
+ }
259
+ }
260
+ var currentLength = set_1.RandexSetUtil.getLength(1, length, [1, 9]);
261
+ return Randex.random([alphabet, "u"], [[alphabet, "l"], currentLength]);
262
+ };
263
+ Randex.numberArray = function (length, count) {
264
+ var min = 0;
265
+ var max = 0;
266
+ var result = [];
267
+ if (typeof length === "number") {
268
+ max = length;
269
+ }
270
+ else {
271
+ min = length[0];
272
+ max = length[1];
273
+ }
274
+ var maxCount = max - min + 1;
275
+ var numberArray = [];
276
+ for (var i = min; i <= max; i++) {
277
+ numberArray.push(i);
278
+ }
279
+ for (var i = 0; i < count && i < maxCount; i++) {
280
+ var arrayCount = numberArray.length - 1;
281
+ var index = Randex.number(arrayCount);
282
+ var value = numberArray[index];
283
+ result.push(value);
284
+ numberArray.splice(index, 1);
285
+ }
286
+ return result;
287
+ };
288
+ // number
289
+ Randex.getNumberBase = function (decimals) {
290
+ return decimals === 1 ? 10 : Math.pow(10, decimals);
291
+ };
292
+ Randex.getNumberValue = function (value, decimals) {
293
+ var result = value;
294
+ if (typeof decimals === "number") {
295
+ result = result * Randex.getNumberBase(decimals);
296
+ }
297
+ return result;
298
+ };
299
+ Randex.innerRandomNumber = function (from, to, decimals) {
300
+ var fromV = Randex.getNumberValue(from, decimals);
301
+ var toV = Randex.getNumberValue(to, decimals);
302
+ var result = set_1.RandexSetUtil.randomNumber(toV - fromV + 1) + fromV;
303
+ if (typeof decimals === "number") {
304
+ result = result / Randex.getNumberBase(decimals);
305
+ }
306
+ return result;
307
+ };
308
+ Randex.number = function (p1, p2, p3) {
309
+ if (typeof p1 === "number" && typeof p2 === "number") {
310
+ return Randex.innerRandomNumber(p1, p2, p3 === null || p3 === void 0 ? void 0 : p3.decimals);
311
+ }
312
+ else {
313
+ var decimals = p2 === null || p2 === void 0 ? void 0 : p2.decimals;
314
+ if (typeof p1 === "number") {
315
+ return Randex.innerRandomNumber(0, p1, decimals);
316
+ }
317
+ else {
318
+ var min = p1[0], max = p1[1];
319
+ return Randex.innerRandomNumber(min, max, decimals);
320
+ }
321
+ }
322
+ };
323
+ Randex.username = function (options) {
324
+ var length = type_1.RandexTypeParser.isLength(options) ? options : options === null || options === void 0 ? void 0 : options.length;
325
+ var currentLength = set_1.RandexSetUtil.getLength(1, length, [6, 10]);
326
+ return Randex.random(["english", "l"], [[["english", "l"], "number"], currentLength]);
327
+ };
328
+ return Randex;
329
+ }());
330
+ exports.Randex = Randex;
@@ -1,6 +1,3 @@
1
- import { RandexLength } from "../interfaces";
2
1
  export interface RandomNumberOptions {
3
2
  decimals?: number;
4
3
  }
5
- export declare function randomNumber(length: RandexLength, options?: RandomNumberOptions): number;
6
- export declare function randomNumber(from: number, to: number, options?: RandomNumberOptions): number;
@@ -1,39 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomNumber = void 0;
4
- var set_1 = require("../basic/set");
5
- function getBase(decimals) {
6
- return decimals === 1 ? 10 : Math.pow(10, decimals);
7
- }
8
- function getValue(value, decimals) {
9
- var result = value;
10
- if (typeof decimals === "number") {
11
- result = result * getBase(decimals);
12
- }
13
- return result;
14
- }
15
- function innerRandomNumber(from, to, decimals) {
16
- var fromV = getValue(from, decimals);
17
- var toV = getValue(to, decimals);
18
- var result = set_1.RandexSetUtil.randomNumber(toV - fromV + 1) + fromV;
19
- if (typeof decimals === "number") {
20
- result = result / getBase(decimals);
21
- }
22
- return result;
23
- }
24
- function randomNumber(p1, p2, p3) {
25
- if (typeof p1 === "number" && typeof p2 === "number") {
26
- return innerRandomNumber(p1, p2, p3 === null || p3 === void 0 ? void 0 : p3.decimals);
27
- }
28
- else {
29
- var decimals = p2 === null || p2 === void 0 ? void 0 : p2.decimals;
30
- if (typeof p1 === "number") {
31
- return innerRandomNumber(0, p1, decimals);
32
- }
33
- else {
34
- var min = p1[0], max = p1[1];
35
- return innerRandomNumber(min, max, decimals);
36
- }
37
- }
38
- }
39
- exports.randomNumber = randomNumber;
@@ -0,0 +1,5 @@
1
+ import { RandexLength } from "../interfaces";
2
+ export interface RandexRangeOptions {
3
+ range: string;
4
+ length: RandexLength;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { RandexAlphabet, RandexLength } from "../interfaces";
2
+ export interface RandexSingleNameOptions {
3
+ alphabet?: RandexAlphabet;
4
+ length?: RandexLength;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,4 +2,3 @@ import { RandexLength } from "../interfaces";
2
2
  export interface RandexUsernameOptions {
3
3
  length?: RandexLength;
4
4
  }
5
- export declare function randomUsername(options?: RandexUsernameOptions | RandexLength): string;
@@ -1,12 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomUsername = void 0;
4
- var basic_1 = require("../basic");
5
- var set_1 = require("../basic/set");
6
- var type_1 = require("../basic/type");
7
- function randomUsername(options) {
8
- var length = type_1.RandexTypeParser.isLength(options) ? options : options === null || options === void 0 ? void 0 : options.length;
9
- var currentLength = set_1.RandexSetUtil.getLength(1, length, [6, 10]);
10
- return (0, basic_1.random)(["english", "l"], [[["english", "l"], "number"], currentLength]);
11
- }
12
- exports.randomUsername = randomUsername;
package/lib/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export * from "./basic";
1
+ import { Randex } from "./custom";
2
+ export * from "./interfaces";
2
3
  export * from "./custom";
4
+ export default Randex;
package/lib/index.js CHANGED
@@ -14,5 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./basic"), exports);
17
+ var custom_1 = require("./custom");
18
+ __exportStar(require("./interfaces"), exports);
18
19
  __exportStar(require("./custom"), exports);
20
+ // eslint-disable-next-line import/no-default-export
21
+ exports.default = custom_1.Randex;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var array_item_1 = require("../custom/array-item");
3
+ var custom_1 = require("../custom");
4
4
  var test_util_1 = require("./test-util");
5
5
  describe("randomArrayItem", function () {
6
6
  it("param: number", function () {
7
7
  var array = [1, 2, 3, 4, 5, 6];
8
8
  var resultArray = {};
9
9
  test_util_1.TestUtil.loop(function () {
10
- var value = (0, array_item_1.randomArrayItem)(array);
10
+ var value = custom_1.Randex.arrayItem(array);
11
11
  resultArray[value] = (resultArray[value] || 0) + 1;
12
12
  });
13
13
  for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var array_1 = require("../custom/array");
3
+ var custom_1 = require("../custom");
4
4
  function testUniqueArray(array, count) {
5
- var value = (0, array_1.randomArray)(array, count);
5
+ var value = custom_1.Randex.array(array, count);
6
6
  var uniqueResult = [];
7
7
  var _loop_1 = function (i) {
8
8
  var uniqueValue = value[i];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var set_1 = require("../basic/set");
4
- var email_1 = require("../custom/email");
4
+ var custom_1 = require("../custom");
5
5
  var test_util_1 = require("./test-util");
6
6
  var r = set_1.RandexSetUtil;
7
7
  function splitEmail(email) {
@@ -25,16 +25,16 @@ function testEmail(options) {
25
25
  describe("randomEmail", function () {
26
26
  it("simple", function () {
27
27
  test_util_1.TestUtil.loop(function () {
28
- var email = (0, email_1.randomEmail)();
28
+ var email = custom_1.Randex.email();
29
29
  testEmail({ email: email });
30
30
  });
31
31
  });
32
32
  it("options: prefixLength", function () {
33
33
  var prefixLength = [10, 15];
34
34
  test_util_1.TestUtil.loop(function () {
35
- var email = (0, email_1.randomEmail)({ prefixLength: prefixLength });
35
+ var email = custom_1.Randex.email({ prefixLength: prefixLength });
36
36
  testEmail({ email: email, prefixLength: prefixLength });
37
- email = (0, email_1.randomEmail)(prefixLength);
37
+ email = custom_1.Randex.email(prefixLength);
38
38
  testEmail({ email: email, prefixLength: prefixLength });
39
39
  });
40
40
  });
@@ -42,18 +42,18 @@ describe("randomEmail", function () {
42
42
  var hightDomainLength = 8;
43
43
  var lowDomainLength = 12;
44
44
  test_util_1.TestUtil.loop(function () {
45
- var email = (0, email_1.randomEmail)({ hightDomainLength: hightDomainLength, lowDomainLength: lowDomainLength });
45
+ var email = custom_1.Randex.email({ hightDomainLength: hightDomainLength, lowDomainLength: lowDomainLength });
46
46
  testEmail({ email: email, hightDomainLength: hightDomainLength, lowDomainLength: lowDomainLength });
47
- email = (0, email_1.randomEmail)(r.defaultEmailPrefixLength, lowDomainLength, hightDomainLength);
47
+ email = custom_1.Randex.email(r.defaultEmailPrefixLength, lowDomainLength, hightDomainLength);
48
48
  testEmail({ email: email, hightDomainLength: hightDomainLength, lowDomainLength: lowDomainLength, prefixLength: r.defaultEmailPrefixLength });
49
49
  });
50
50
  });
51
51
  it("options: domain", function () {
52
52
  var domain = "delta.com";
53
53
  test_util_1.TestUtil.loop(function () {
54
- var email = (0, email_1.randomEmail)({ domain: domain });
54
+ var email = custom_1.Randex.email({ domain: domain });
55
55
  testEmail({ email: email, domain: domain });
56
- email = (0, email_1.randomEmail)(domain);
56
+ email = custom_1.Randex.email(domain);
57
57
  testEmail({ email: email, domain: domain });
58
58
  });
59
59
  });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var set_1 = require("../basic/set");
4
- var filename_1 = require("../custom/filename");
4
+ var custom_1 = require("../custom");
5
5
  var test_util_1 = require("./test-util");
6
6
  var r = set_1.RandexSetUtil;
7
7
  function splitFileName(fullFileName) {
@@ -27,25 +27,25 @@ function testFileName(options) {
27
27
  describe("randomFileName", function () {
28
28
  it("simple", function () {
29
29
  test_util_1.TestUtil.loop(function () {
30
- var fullFileName = (0, filename_1.randomFileName)();
30
+ var fullFileName = custom_1.Randex.fileName();
31
31
  testFileName({ fullFileName: fullFileName });
32
32
  });
33
33
  });
34
34
  it("params: fileNameLength", function () {
35
35
  var fileNameLength = [10, 15];
36
36
  test_util_1.TestUtil.loop(function () {
37
- var fullFileName = (0, filename_1.randomFileName)({ fileNameLength: fileNameLength });
37
+ var fullFileName = custom_1.Randex.fileName({ fileNameLength: fileNameLength });
38
38
  testFileName({ fullFileName: fullFileName, fileNameLength: fileNameLength });
39
- fullFileName = (0, filename_1.randomFileName)(fileNameLength);
39
+ fullFileName = custom_1.Randex.fileName(fileNameLength);
40
40
  testFileName({ fullFileName: fullFileName, fileNameLength: fileNameLength });
41
41
  });
42
42
  });
43
43
  it("params: extensionLength", function () {
44
44
  var extensionLength = [10, 15];
45
45
  test_util_1.TestUtil.loop(function () {
46
- var fullFileName = (0, filename_1.randomFileName)({ extensionLength: extensionLength });
46
+ var fullFileName = custom_1.Randex.fileName({ extensionLength: extensionLength });
47
47
  testFileName({ fullFileName: fullFileName, extensionLength: extensionLength });
48
- fullFileName = (0, filename_1.randomFileName)(r.defaultFileNameLength, extensionLength);
48
+ fullFileName = custom_1.Randex.fileName(r.defaultFileNameLength, extensionLength);
49
49
  testFileName({ fullFileName: fullFileName, fileNameLength: r.defaultFileNameLength, extensionLength: extensionLength });
50
50
  });
51
51
  });
@@ -53,13 +53,13 @@ describe("randomFileName", function () {
53
53
  var fileNameLength = [10, 15];
54
54
  var extension = "xml";
55
55
  test_util_1.TestUtil.loop(function () {
56
- var fullFileName = (0, filename_1.randomFileName)({ extension: extension });
56
+ var fullFileName = custom_1.Randex.fileName({ extension: extension });
57
57
  testFileName({ fullFileName: fullFileName, extension: extension });
58
- fullFileName = (0, filename_1.randomFileName)(extension);
58
+ fullFileName = custom_1.Randex.fileName(extension);
59
59
  testFileName({ fullFileName: fullFileName, extension: extension });
60
- fullFileName = (0, filename_1.randomFileName)("." + extension);
60
+ fullFileName = custom_1.Randex.fileName("." + extension);
61
61
  testFileName({ fullFileName: fullFileName, extension: extension });
62
- fullFileName = (0, filename_1.randomFileName)(fileNameLength, extension);
62
+ fullFileName = custom_1.Randex.fileName(fileNameLength, extension);
63
63
  testFileName({ fullFileName: fullFileName, fileNameLength: fileNameLength, extension: extension });
64
64
  });
65
65
  });
@@ -5,7 +5,7 @@ var test_util_1 = require("./test-util");
5
5
  describe("randomFullName", function () {
6
6
  it("simple", function () {
7
7
  test_util_1.TestUtil.loop(function () {
8
- var value = (0, custom_1.randomFullName)();
8
+ var value = custom_1.Randex.fullName();
9
9
  expect(test_util_1.TestUtil.isFullNameValid(value)).toBeTruthy();
10
10
  });
11
11
  });