@rtsee/utilities 0.0.38 → 0.0.40
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/identity-generator/index.d.ts +2 -0
- package/dist/identity-generator/index.d.ts.map +1 -0
- package/dist/identity-generator/index.js +14 -0
- package/dist/identity-generator/index.js.map +1 -0
- package/dist/identity-generator/mocks/images.d.ts +3 -0
- package/dist/identity-generator/mocks/images.d.ts.map +1 -0
- package/dist/identity-generator/mocks/images.js +35 -0
- package/dist/identity-generator/mocks/images.js.map +1 -0
- package/dist/identity-generator/mocks/names.d.ts +4 -0
- package/dist/identity-generator/mocks/names.d.ts.map +1 -0
- package/dist/identity-generator/mocks/names.js +121 -0
- package/dist/identity-generator/mocks/names.js.map +1 -0
- package/dist/identity-generator/models/IdentityGenerator.d.ts +28 -0
- package/dist/identity-generator/models/IdentityGenerator.d.ts.map +1 -0
- package/dist/identity-generator/models/IdentityGenerator.js +75 -0
- package/dist/identity-generator/models/IdentityGenerator.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity-generator/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./models/IdentityGenerator"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity-generator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../src/identity-generator/mocks/images.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,EAoB9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,EAShC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.femaleImages = exports.maleImages = void 0;
|
|
4
|
+
exports.maleImages = [
|
|
5
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/b8a9584f-664a-4ce0-ab27-a80cad32430b_38b6b358e3d2e260f24fcfb29072f429--lelouch-lamperouge-code-geass.jpeg",
|
|
6
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/63e6a72f-22db-4776-8fb8-366e74a57460_images.jpeg",
|
|
7
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/4caa99ee-efb6-47ab-857a-a6a0b6f55877_2ff8ec37c75ce0dd119b788d826058b1.jpeg",
|
|
8
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/6914c067-9b91-476a-a2a8-75f15ef3812e_download+%283%29.jpeg",
|
|
9
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/b29b4972-1f20-40ef-95b6-8190ed5984eb_9097087_900.jpeg",
|
|
10
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/69f18b77-d7c5-4095-a18d-a8d3ba9b762d_download+%282%29.jpeg",
|
|
11
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/84cb550d-c3ee-45c5-b652-259ee917ecad_terminator2_movie_screencaps.com_3973.jpg",
|
|
12
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/5d74d138-ade7-4cc6-81bf-a549f17bfa73_download+%281%29.jpeg",
|
|
13
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/7a53fddd-5857-4475-a2c3-e808e32dbc8e_funimation-1.jpeg",
|
|
14
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/c1875eba-9ff1-4723-a0cf-9553599ea733_111222.5960182.jpg",
|
|
15
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/c21d38f2-b2b0-43e7-826c-a7ba5d19cf18_2022-07-11+10.17.11.jpg",
|
|
16
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/5b482ec3-067d-4f63-8a95-3e53a8d358a3_2022-07-11+10.12.05.jpg",
|
|
17
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/f99e92c1-be7a-449f-935a-fa7d68857711_2022-07-11+10.12.05.jpg",
|
|
18
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/9c694958-b110-4429-b32f-066181e358d5_2022-07-11+10.22.30.jpg",
|
|
19
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/66ae119c-2dfd-45ba-8a70-db40209b0905_24b31eb0b9d7b6fcc71a38f4a57a2d62--merry-and-pippin-lord-of-the-rings.jpeg",
|
|
20
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/6bedcc2b-bb62-4df7-b0be-e2bf177eb907_Frodo.jpeg",
|
|
21
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/944d255c-11ca-44d1-9285-ad6b2b0e8e93_2022-07-11+15.38.03.jpg",
|
|
22
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/93107ab5-684a-4a22-b523-e5b354ba5f77_2022-07-11+15.37.35.jpg",
|
|
23
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/530e9fe2-2da0-4ff5-b3be-9fc8387729d9_2022-07-11+15.37.05.jpg",
|
|
24
|
+
];
|
|
25
|
+
exports.femaleImages = [
|
|
26
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/a38be2cf-a6e8-4ca1-83c5-6419eac7c57c_b2063-7BKqQbrhtDD2.png",
|
|
27
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/a8f4f225-b859-4389-a14a-58690269eed0_download+%284%29.jpeg",
|
|
28
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/2d3b519a-e6ab-4077-9024-a609c53d3de0_e3ecc1713d8d08d538f5334413c5000d.jpeg",
|
|
29
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/998d1037-174a-4fd7-a23d-55d1169e9d05_254cc9dc5b34c2467f2282c20b2d6758.jpeg",
|
|
30
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/752966d3-b64f-4560-bdac-c952d6ac296a_audrey-sorensen-34284500-385135055306477-5010316737921417216-n.jpeg",
|
|
31
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/a9279048-bd9f-472c-ba73-44f4b17a41ae_Sarah-Connor-Terminator-Linda-Hamilton-a.jpeg",
|
|
32
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/719c3abc-ba05-4ad2-9da2-4294a5c8a2a3_2022-07-11+10.28.38.jpg",
|
|
33
|
+
"https://test-bucket-werf.s3.eu-central-1.amazonaws.com/0fa02b0e-6422-4200-8b04-13c1dd73b172_2022-07-11+15.41.33.jpg",
|
|
34
|
+
];
|
|
35
|
+
//# sourceMappingURL=images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../src/identity-generator/mocks/images.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAa;IAClC,kKAAkK;IAClK,yGAAyG;IACzG,mIAAmI;IACnI,mHAAmH;IACnH,8GAA8G;IAC9G,mHAAmH;IACnH,uIAAuI;IACvI,mHAAmH;IACnH,+GAA+G;IAC/G,gHAAgH;IAChH,qHAAqH;IACrH,qHAAqH;IACrH,qHAAqH;IACrH,qHAAqH;IACrH,uKAAuK;IACvK,wGAAwG;IACxG,qHAAqH;IACrH,qHAAqH;IACrH,qHAAqH;CACtH,CAAC;AAEW,QAAA,YAAY,GAAa;IACpC,oHAAoH;IACpH,mHAAmH;IACnH,mIAAmI;IACnI,mIAAmI;IACnI,iKAAiK;IACjK,2IAA2I;IAC3I,qHAAqH;IACrH,qHAAqH;CACtH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../src/identity-generator/mocks/names.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,EAAE,MAAM,EAkDlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAoBpC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,EA4C7B,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lastNames = exports.femaleFirstNames = exports.maleFirstNames = void 0;
|
|
4
|
+
exports.maleFirstNames = [
|
|
5
|
+
"Anakin",
|
|
6
|
+
"Luke",
|
|
7
|
+
"Obi Wan",
|
|
8
|
+
"Martin",
|
|
9
|
+
"J. R. R. Martin",
|
|
10
|
+
"Fedmahn",
|
|
11
|
+
"Lenar",
|
|
12
|
+
"Sol",
|
|
13
|
+
"Ronald",
|
|
14
|
+
"Naruto",
|
|
15
|
+
"Frodo",
|
|
16
|
+
"Bilbo",
|
|
17
|
+
"Legolas",
|
|
18
|
+
"Gimly",
|
|
19
|
+
"Gloin",
|
|
20
|
+
"Dwalin",
|
|
21
|
+
"Balin",
|
|
22
|
+
"Kili",
|
|
23
|
+
"Fili",
|
|
24
|
+
"Dori",
|
|
25
|
+
"Nori",
|
|
26
|
+
"Ori",
|
|
27
|
+
"Oin",
|
|
28
|
+
"Gloin",
|
|
29
|
+
"Bifur",
|
|
30
|
+
"Bofur",
|
|
31
|
+
"Bombur",
|
|
32
|
+
"Thorin",
|
|
33
|
+
"Orochimaru",
|
|
34
|
+
"Ichigo",
|
|
35
|
+
"Kakashi",
|
|
36
|
+
"Jon",
|
|
37
|
+
"John",
|
|
38
|
+
"Theon",
|
|
39
|
+
"Teon",
|
|
40
|
+
"Rand",
|
|
41
|
+
"Perrin",
|
|
42
|
+
"Matt",
|
|
43
|
+
"Dzirt",
|
|
44
|
+
"Logen",
|
|
45
|
+
"Caul",
|
|
46
|
+
"Nicomo",
|
|
47
|
+
"Castor",
|
|
48
|
+
"Faithful",
|
|
49
|
+
"Bayaz",
|
|
50
|
+
"Conan",
|
|
51
|
+
"Melia",
|
|
52
|
+
"Duke",
|
|
53
|
+
"Bremer",
|
|
54
|
+
];
|
|
55
|
+
exports.femaleFirstNames = [
|
|
56
|
+
"Lamia",
|
|
57
|
+
"Arya",
|
|
58
|
+
"Nynaeve",
|
|
59
|
+
"Xena",
|
|
60
|
+
"Gera",
|
|
61
|
+
"Leela",
|
|
62
|
+
"Hermione",
|
|
63
|
+
"Sarah",
|
|
64
|
+
"Mary-Jane",
|
|
65
|
+
"Belatrix",
|
|
66
|
+
"Zelda",
|
|
67
|
+
"Buffy",
|
|
68
|
+
"Jean",
|
|
69
|
+
"Egwene",
|
|
70
|
+
"Siuan",
|
|
71
|
+
"Morayne",
|
|
72
|
+
"Monza",
|
|
73
|
+
"Lara",
|
|
74
|
+
"Ahsoka",
|
|
75
|
+
];
|
|
76
|
+
exports.lastNames = [
|
|
77
|
+
"Al Thor",
|
|
78
|
+
"Aybara",
|
|
79
|
+
"Cauthron",
|
|
80
|
+
"Veider",
|
|
81
|
+
"Palpatine",
|
|
82
|
+
"Maul",
|
|
83
|
+
"Hatake",
|
|
84
|
+
"Uzumaki",
|
|
85
|
+
"Uchia",
|
|
86
|
+
"Organo",
|
|
87
|
+
"Skywalker",
|
|
88
|
+
"Connors",
|
|
89
|
+
"Summers",
|
|
90
|
+
"Sedai",
|
|
91
|
+
"Ninefingers",
|
|
92
|
+
"Shivers",
|
|
93
|
+
"Murcatto",
|
|
94
|
+
"Cosca",
|
|
95
|
+
"Morveer",
|
|
96
|
+
"Carpi",
|
|
97
|
+
"Rogont",
|
|
98
|
+
"Mauthis",
|
|
99
|
+
"dan Gorst",
|
|
100
|
+
"Magi",
|
|
101
|
+
"Jalenhorm",
|
|
102
|
+
"Kenobi",
|
|
103
|
+
"Windu",
|
|
104
|
+
"The Barbarian",
|
|
105
|
+
"Ablar",
|
|
106
|
+
"Asunawa",
|
|
107
|
+
"Bashere",
|
|
108
|
+
"Bryne",
|
|
109
|
+
"Damodred",
|
|
110
|
+
"Ohmsford",
|
|
111
|
+
"Ross",
|
|
112
|
+
"Nukkem",
|
|
113
|
+
"Croft",
|
|
114
|
+
"Tano",
|
|
115
|
+
"Brawne",
|
|
116
|
+
"Silenus",
|
|
117
|
+
"Kassad",
|
|
118
|
+
"Weintraub",
|
|
119
|
+
"Hoyt",
|
|
120
|
+
];
|
|
121
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../../src/identity-generator/mocks/names.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAa;IACtC,QAAQ;IACR,MAAM;IACN,SAAS;IACT,QAAQ;IACR,iBAAiB;IACjB,SAAS;IACT,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,QAAQ;IACR,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;CACT,CAAC;AAEW,QAAA,gBAAgB,GAAa;IACxC,OAAO;IACP,MAAM;IACN,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,UAAU;IACV,OAAO;IACP,WAAW;IACX,UAAU;IACV,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,MAAM;IACN,QAAQ;CACT,CAAC;AAEW,QAAA,SAAS,GAAa;IACjC,SAAS;IACT,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,WAAW;IACX,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,WAAW;IACX,SAAS;IACT,SAAS;IACT,OAAO;IACP,aAAa;IACb,SAAS;IACT,UAAU;IACV,OAAO;IACP,SAAS;IACT,OAAO;IACP,QAAQ;IACR,SAAS;IACT,WAAW;IACX,MAAM;IACN,WAAW;IACX,QAAQ;IACR,OAAO;IACP,eAAe;IACf,OAAO;IACP,SAAS;IACT,SAAS;IACT,OAAO;IACP,UAAU;IACV,UAAU;IACV,MAAM;IACN,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,WAAW;IACX,MAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface IIdentityGeneratorOptions {
|
|
2
|
+
maleFirstNames?: string[];
|
|
3
|
+
femaleFirstNames?: string[];
|
|
4
|
+
maleImageUrls?: string[];
|
|
5
|
+
femaleImageUrls?: string[];
|
|
6
|
+
lastNames?: string[];
|
|
7
|
+
useDefaultNamesPool?: boolean;
|
|
8
|
+
useDefaultImageUrlsPool?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class IdentityGenerator {
|
|
11
|
+
maleFirstNamesPool: string[];
|
|
12
|
+
femaleFirstNamesPool: string[];
|
|
13
|
+
maleImageUrlsPool: string[];
|
|
14
|
+
femaleImageUrlsPool: string[];
|
|
15
|
+
lastNamesPool: string[];
|
|
16
|
+
useDefaultNamesPool: boolean;
|
|
17
|
+
useDefaultImageUrlsPool: boolean;
|
|
18
|
+
constructor(options?: IIdentityGeneratorOptions);
|
|
19
|
+
create(isMale?: boolean): {
|
|
20
|
+
name: string;
|
|
21
|
+
imageUrl: string;
|
|
22
|
+
};
|
|
23
|
+
pickRandomFullName(isMale: boolean): string;
|
|
24
|
+
pickRandomFirstName(isMale: boolean): string;
|
|
25
|
+
pickRandomLastName(): string;
|
|
26
|
+
pickRandomImageUrl(isMale: boolean): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=IdentityGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityGenerator.d.ts","sourceRoot":"","sources":["../../../src/identity-generator/models/IdentityGenerator.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,qBAAa,iBAAiB;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAM;IAClC,oBAAoB,EAAE,MAAM,EAAE,CAAM;IACpC,iBAAiB,EAAE,MAAM,EAAE,CAAM;IACjC,mBAAmB,EAAE,MAAM,EAAE,CAAM;IACnC,aAAa,EAAE,MAAM,EAAE,CAAM;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,uBAAuB,EAAE,OAAO,CAAC;gBAErB,OAAO,GAAE,yBAA8B;IAiDnD,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB;IAWD,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;IAI3C,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;IAK5C,kBAAkB,IAAI,MAAM;IAM5B,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;CAI5C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdentityGenerator = void 0;
|
|
4
|
+
var names_1 = require("../mocks/names");
|
|
5
|
+
var images_1 = require("../mocks/images");
|
|
6
|
+
var IdentityGenerator = /** @class */ (function () {
|
|
7
|
+
function IdentityGenerator(options) {
|
|
8
|
+
if (options === void 0) { options = {}; }
|
|
9
|
+
this.maleFirstNamesPool = [];
|
|
10
|
+
this.femaleFirstNamesPool = [];
|
|
11
|
+
this.maleImageUrlsPool = [];
|
|
12
|
+
this.femaleImageUrlsPool = [];
|
|
13
|
+
this.lastNamesPool = [];
|
|
14
|
+
if ((!options.femaleFirstNames &&
|
|
15
|
+
!options.maleFirstNames &&
|
|
16
|
+
!options.lastNames) ||
|
|
17
|
+
options.useDefaultNamesPool) {
|
|
18
|
+
this.useDefaultNamesPool = true;
|
|
19
|
+
}
|
|
20
|
+
if (options.useDefaultImageUrlsPool ||
|
|
21
|
+
(!options.maleImageUrls && !options.femaleImageUrls)) {
|
|
22
|
+
this.useDefaultImageUrlsPool = true;
|
|
23
|
+
}
|
|
24
|
+
if (this.useDefaultNamesPool) {
|
|
25
|
+
this.maleFirstNamesPool = names_1.maleFirstNames;
|
|
26
|
+
this.femaleFirstNamesPool = names_1.femaleFirstNames;
|
|
27
|
+
this.lastNamesPool = names_1.lastNames;
|
|
28
|
+
}
|
|
29
|
+
if (this.useDefaultImageUrlsPool) {
|
|
30
|
+
this.maleImageUrlsPool = images_1.maleImages;
|
|
31
|
+
this.femaleImageUrlsPool = images_1.femaleImages;
|
|
32
|
+
}
|
|
33
|
+
if (options.maleFirstNames) {
|
|
34
|
+
this.maleFirstNamesPool.concat(options.maleFirstNames);
|
|
35
|
+
}
|
|
36
|
+
if (options.femaleFirstNames) {
|
|
37
|
+
this.femaleFirstNamesPool.concat(options.femaleFirstNames);
|
|
38
|
+
}
|
|
39
|
+
if (options.maleImageUrls) {
|
|
40
|
+
this.maleImageUrlsPool.concat(options.maleImageUrls);
|
|
41
|
+
}
|
|
42
|
+
if (options.femaleImageUrls) {
|
|
43
|
+
this.femaleImageUrlsPool.concat(options.femaleImageUrls);
|
|
44
|
+
}
|
|
45
|
+
if (options.lastNames) {
|
|
46
|
+
this.lastNamesPool.concat(options.lastNames);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
IdentityGenerator.prototype.create = function (isMale) {
|
|
50
|
+
if (isMale === undefined) {
|
|
51
|
+
isMale = Math.random() > 0.5;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
name: this.pickRandomFullName(isMale),
|
|
55
|
+
imageUrl: this.pickRandomImageUrl(isMale),
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
IdentityGenerator.prototype.pickRandomFullName = function (isMale) {
|
|
59
|
+
return this.pickRandomFirstName(isMale) + " " + this.pickRandomLastName();
|
|
60
|
+
};
|
|
61
|
+
IdentityGenerator.prototype.pickRandomFirstName = function (isMale) {
|
|
62
|
+
var pool = isMale ? this.maleFirstNamesPool : this.femaleFirstNamesPool;
|
|
63
|
+
return pool[Math.floor(Math.random() * pool.length)];
|
|
64
|
+
};
|
|
65
|
+
IdentityGenerator.prototype.pickRandomLastName = function () {
|
|
66
|
+
return this.lastNamesPool[Math.floor(Math.random() * this.lastNamesPool.length)];
|
|
67
|
+
};
|
|
68
|
+
IdentityGenerator.prototype.pickRandomImageUrl = function (isMale) {
|
|
69
|
+
var pool = isMale ? this.maleImageUrlsPool : this.femaleImageUrlsPool;
|
|
70
|
+
return pool[Math.floor(Math.random() * pool.length)];
|
|
71
|
+
};
|
|
72
|
+
return IdentityGenerator;
|
|
73
|
+
}());
|
|
74
|
+
exports.IdentityGenerator = IdentityGenerator;
|
|
75
|
+
//# sourceMappingURL=IdentityGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityGenerator.js","sourceRoot":"","sources":["../../../src/identity-generator/models/IdentityGenerator.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./identity-generator"), exports);
|
|
1
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rtsee/utilities",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"clean": "rm -rf ./dist",
|
|
19
19
|
"build": "yarn clean && yarn compile",
|
|
20
20
|
"compile": "tsc -p tsconfig.json",
|
|
21
|
+
"watch": "tsc -p tsconfig.json --watch",
|
|
21
22
|
"lint-file:eslint": "yarn eslint",
|
|
22
23
|
"lint-file:prettier": "yarn prettier --check",
|
|
23
24
|
"lint:eslint": "yarn lint-file:eslint 'src/**/*.ts'",
|
|
@@ -34,15 +35,15 @@
|
|
|
34
35
|
"jest-watch-yarn-workspaces": "^1.1.0",
|
|
35
36
|
"prettier": "^2.3.2",
|
|
36
37
|
"ts-jest": "^27.0.3",
|
|
37
|
-
"typescript": "
|
|
38
|
+
"typescript": "~4.4.4"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@types/events": "^3.0.0",
|
|
41
42
|
"events": "^3.3.0",
|
|
42
|
-
"webrtc-adapter": "^8.
|
|
43
|
+
"webrtc-adapter": "^8.1.2"
|
|
43
44
|
},
|
|
44
45
|
"publishConfig": {
|
|
45
46
|
"access": "public"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "1b63380ca99abfb7597eb27c0368f1222c983b27"
|
|
48
49
|
}
|