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
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomName = void 0;
4
- var basic_1 = require("../basic");
5
- var set_1 = require("../basic/set");
6
- var type_1 = require("../basic/type");
7
- function randomName(p1, p2) {
8
- var length = 0;
9
- var alphabet = "english";
10
- if (type_1.RandexTypeParser.isLength(p1)) {
11
- length = p1;
12
- }
13
- else if (type_1.RandexTypeParser.inAlphabet(p1)) {
14
- alphabet = p1;
15
- if (type_1.RandexTypeParser.isLength(p2)) {
16
- length = p2;
17
- }
18
- }
19
- else if (typeof p1 === "object") {
20
- if (p1.alphabet) {
21
- alphabet = p1.alphabet;
22
- }
23
- if (p1.length) {
24
- length = p1.length;
25
- }
26
- }
27
- var currentLength = set_1.RandexSetUtil.getLength(1, length, [1, 9]);
28
- return (0, basic_1.random)([alphabet, "u"], [[alphabet, "l"], currentLength]);
29
- }
30
- exports.randomName = randomName;
@@ -1,2 +0,0 @@
1
- import { RandexLength } from "../interfaces";
2
- export declare function randomNumberArray(length: RandexLength, count: number): number[];
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomNumberArray = void 0;
4
- var number_1 = require("./number");
5
- function randomNumberArray(length, count) {
6
- var min = 0;
7
- var max = 0;
8
- var result = [];
9
- if (typeof length === "number") {
10
- max = length;
11
- }
12
- else {
13
- min = length[0];
14
- max = length[1];
15
- }
16
- var maxCount = max - min + 1;
17
- var numberArray = [];
18
- for (var i = min; i <= max; i++) {
19
- numberArray.push(i);
20
- }
21
- for (var i = 0; i < count && i < maxCount; i++) {
22
- var arrayCount = numberArray.length - 1;
23
- var index = (0, number_1.randomNumber)(arrayCount);
24
- var value = numberArray[index];
25
- result.push(value);
26
- numberArray.splice(index, 1);
27
- }
28
- return result;
29
- }
30
- exports.randomNumberArray = randomNumberArray;