@dxos/random 0.8.3 → 0.8.4-main.2e9d522

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/random",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.2e9d522",
4
4
  "description": "Random data generator.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -28,8 +28,8 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "@ngneat/falso": "^7.1.1",
31
- "@dxos/node-std": "0.8.3",
32
- "@dxos/util": "0.8.3"
31
+ "@dxos/node-std": "0.8.4-main.2e9d522",
32
+ "@dxos/util": "0.8.4-main.2e9d522"
33
33
  },
34
34
  "devDependencies": {},
35
35
  "publishConfig": {
@@ -1,602 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var node_exports = {};
21
- __export(node_exports, {
22
- faker: () => faker
23
- });
24
- module.exports = __toCommonJS(node_exports);
25
- __reExport(node_exports, require("@ngneat/falso"), module.exports);
26
- var import_falso = require("@ngneat/falso");
27
- var import_util = require("@dxos/util");
28
- var import_falso2 = require("@ngneat/falso");
29
- var airports = [
30
- {
31
- name: "Atlanta",
32
- code: "ATL",
33
- location: [
34
- -84.4277,
35
- 33.6407
36
- ]
37
- },
38
- {
39
- name: "Dubai",
40
- code: "DXB",
41
- location: [
42
- 55.3644,
43
- 25.2532
44
- ]
45
- },
46
- {
47
- name: "Dallas",
48
- code: "DFW",
49
- location: [
50
- -97.0403,
51
- 32.8998
52
- ]
53
- },
54
- {
55
- name: "London",
56
- code: "LHR",
57
- location: [
58
- -0.4543,
59
- 51.47
60
- ]
61
- },
62
- {
63
- name: "Tokyo",
64
- code: "HND",
65
- location: [
66
- 139.7811,
67
- 35.5494
68
- ]
69
- },
70
- {
71
- name: "Denver",
72
- code: "DEN",
73
- location: [
74
- -104.6737,
75
- 39.8561
76
- ]
77
- },
78
- {
79
- name: "Istanbul",
80
- code: "IST",
81
- location: [
82
- 28.8153,
83
- 41.2753
84
- ]
85
- },
86
- {
87
- name: "Los Angeles",
88
- code: "LAX",
89
- location: [
90
- -118.4085,
91
- 33.9416
92
- ]
93
- },
94
- {
95
- name: "Paris",
96
- code: "CDG",
97
- location: [
98
- 2.55,
99
- 49.0097
100
- ]
101
- },
102
- {
103
- name: "Guangzhou",
104
- code: "CAN",
105
- location: [
106
- 113.2971,
107
- 23.3924
108
- ]
109
- },
110
- {
111
- name: "Frankfurt",
112
- code: "FRA",
113
- location: [
114
- 8.5706,
115
- 50.0333
116
- ]
117
- },
118
- {
119
- name: "Delhi",
120
- code: "DEL",
121
- location: [
122
- 77.1031,
123
- 28.5562
124
- ]
125
- },
126
- {
127
- name: "Singapore",
128
- code: "SIN",
129
- location: [
130
- 103.994,
131
- 1.3644
132
- ]
133
- },
134
- {
135
- name: "Amsterdam",
136
- code: "AMS",
137
- location: [
138
- 4.7639,
139
- 52.3105
140
- ]
141
- },
142
- {
143
- name: "Seoul",
144
- code: "ICN",
145
- location: [
146
- 126.4505,
147
- 37.4602
148
- ]
149
- },
150
- {
151
- name: "Jakarta",
152
- code: "CGK",
153
- location: [
154
- 106.6559,
155
- -6.1256
156
- ]
157
- },
158
- {
159
- name: "Bangkok",
160
- code: "BKK",
161
- location: [
162
- 100.7501,
163
- 13.6899
164
- ]
165
- },
166
- {
167
- name: "Hong Kong",
168
- code: "HKG",
169
- location: [
170
- 113.9185,
171
- 22.308
172
- ]
173
- },
174
- {
175
- name: "Madrid",
176
- code: "MAD",
177
- location: [
178
- -3.5676,
179
- 40.4936
180
- ]
181
- },
182
- {
183
- name: "San Francisco",
184
- code: "SFO",
185
- location: [
186
- -122.379,
187
- 37.6213
188
- ]
189
- },
190
- {
191
- name: "New York",
192
- code: "JFK",
193
- location: [
194
- -73.7781,
195
- 40.6413
196
- ]
197
- },
198
- {
199
- name: "Chicago",
200
- code: "ORD",
201
- location: [
202
- -87.9048,
203
- 41.9742
204
- ]
205
- },
206
- {
207
- name: "Shanghai",
208
- code: "PVG",
209
- location: [
210
- 121.8083,
211
- 31.1434
212
- ]
213
- },
214
- {
215
- name: "Beijing",
216
- code: "PEK",
217
- location: [
218
- 116.4074,
219
- 39.9042
220
- ]
221
- },
222
- {
223
- name: "Miami",
224
- code: "MIA",
225
- location: [
226
- -80.2906,
227
- 25.7959
228
- ]
229
- },
230
- {
231
- name: "Houston",
232
- code: "IAH",
233
- location: [
234
- -95.3414,
235
- 29.9844
236
- ]
237
- },
238
- {
239
- name: "Munich",
240
- code: "MUC",
241
- location: [
242
- 11.7861,
243
- 48.3538
244
- ]
245
- },
246
- {
247
- name: "Toronto",
248
- code: "YYZ",
249
- location: [
250
- -79.6306,
251
- 43.6777
252
- ]
253
- },
254
- {
255
- name: "Sydney",
256
- code: "SYD",
257
- location: [
258
- 151.1799,
259
- -33.9399
260
- ]
261
- },
262
- {
263
- name: "Melbourne",
264
- code: "MEL",
265
- location: [
266
- 144.843,
267
- -37.6733
268
- ]
269
- },
270
- {
271
- name: "Rome",
272
- code: "FCO",
273
- location: [
274
- 12.2508,
275
- 41.8003
276
- ]
277
- },
278
- {
279
- name: "Barcelona",
280
- code: "BCN",
281
- location: [
282
- 2.0759,
283
- 41.2974
284
- ]
285
- },
286
- {
287
- name: "Kuala Lumpur",
288
- code: "KUL",
289
- location: [
290
- 101.7099,
291
- 2.7456
292
- ]
293
- },
294
- {
295
- name: "Doha",
296
- code: "DOH",
297
- location: [
298
- 51.6136,
299
- 25.2731
300
- ]
301
- },
302
- {
303
- name: "Vienna",
304
- code: "VIE",
305
- location: [
306
- 16.5697,
307
- 48.1103
308
- ]
309
- },
310
- {
311
- name: "Zurich",
312
- code: "ZRH",
313
- location: [
314
- 8.5492,
315
- 47.4583
316
- ]
317
- },
318
- {
319
- name: "Brussels",
320
- code: "BRU",
321
- location: [
322
- 4.4844,
323
- 50.901
324
- ]
325
- },
326
- {
327
- name: "Copenhagen",
328
- code: "CPH",
329
- location: [
330
- 12.6508,
331
- 55.6181
332
- ]
333
- },
334
- {
335
- name: "Oslo",
336
- code: "OSL",
337
- location: [
338
- 11.1004,
339
- 60.1939
340
- ]
341
- },
342
- {
343
- name: "Stockholm",
344
- code: "ARN",
345
- location: [
346
- 17.9186,
347
- 59.6519
348
- ]
349
- },
350
- {
351
- name: "Helsinki",
352
- code: "HEL",
353
- location: [
354
- 24.9633,
355
- 60.3172
356
- ]
357
- },
358
- {
359
- name: "Lisbon",
360
- code: "LIS",
361
- location: [
362
- -9.1359,
363
- 38.7742
364
- ]
365
- },
366
- {
367
- name: "Athens",
368
- code: "ATH",
369
- location: [
370
- 23.9445,
371
- 37.9364
372
- ]
373
- },
374
- {
375
- name: "Warsaw",
376
- code: "WAW",
377
- location: [
378
- 20.9671,
379
- 52.1657
380
- ]
381
- },
382
- {
383
- name: "Budapest",
384
- code: "BUD",
385
- location: [
386
- 19.261,
387
- 47.433
388
- ]
389
- },
390
- {
391
- name: "Prague",
392
- code: "PRG",
393
- location: [
394
- 14.2632,
395
- 50.1008
396
- ]
397
- },
398
- {
399
- name: "Moscow",
400
- code: "SVO",
401
- location: [
402
- 37.4146,
403
- 55.9726
404
- ]
405
- },
406
- {
407
- name: "Dubai",
408
- code: "DXB",
409
- location: [
410
- 55.3644,
411
- 25.2532
412
- ]
413
- }
414
- ];
415
- var icons = [
416
- "ph--air-traffic-control--regular",
417
- "ph--asterisk--regular",
418
- "ph--atom--regular",
419
- "ph--basketball--regular",
420
- "ph--butterfly--regular",
421
- "ph--cactus--regular",
422
- "ph--cake--regular",
423
- "ph--calendar-dots--regular",
424
- "ph--campfire--regular",
425
- "ph--command--regular",
426
- "ph--confetti--regular",
427
- "ph--detective--regular",
428
- "ph--disco-ball--regular",
429
- "ph--dna--regular",
430
- "ph--factory--regular",
431
- "ph--flag-banner-fold--regular",
432
- "ph--flask--regular",
433
- "ph--flower-lotus--regular",
434
- "ph--flying-saucer--regular",
435
- "ph--game-controller--regular",
436
- "ph--gavel--regular",
437
- "ph--gift--regular",
438
- "ph--guitar--regular",
439
- "ph--hamburger--regular",
440
- "ph--handshake--regular",
441
- "ph--heart--regular",
442
- "ph--lightbulb--regular",
443
- "ph--lock--regular",
444
- "ph--martini--regular",
445
- "ph--medal-military--regular",
446
- "ph--moped-front--regular",
447
- "ph--office-chair--regular",
448
- "ph--paint-brush-household--regular",
449
- "ph--peace--regular",
450
- "ph--person-simple-hike--regular",
451
- "ph--piggy-bank--regular",
452
- "ph--potted-plant--regular",
453
- "ph--radioactive--regular",
454
- "ph--rocket-launch--regular",
455
- "ph--shield-star--regular",
456
- "ph--shopping-cart--regular",
457
- "ph--stethoscope--regular",
458
- "ph--student--regular",
459
- "ph--sun--regular",
460
- "ph--tote--regular",
461
- "ph--tree--regular",
462
- "ph--users-three--regular",
463
- "ph--yin-yang--regular"
464
- ];
465
- var toRange = (range, min = 0) => typeof range === "number" ? {
466
- min,
467
- max: range
468
- } : range;
469
- var getCount = (range) => typeof range === "number" ? range : (0, import_falso2.randNumber)(range);
470
- var multiple = (fn, n) => {
471
- return Array.from({
472
- length: n
473
- }).map((_, i) => fn(i));
474
- };
475
- var uniqueArray = (values, n) => {
476
- if (Array.isArray(values)) {
477
- const results = [];
478
- const selection = Array.from(new Set(values));
479
- for (let i = 0; i < n; i++) {
480
- if (selection.length === 0) {
481
- break;
482
- }
483
- results.push(selection.splice(Math.floor(Math.random() * selection.length), 1)[0]);
484
- }
485
- return results;
486
- } else {
487
- const results = /* @__PURE__ */ new Set();
488
- while (results.size < n) {
489
- results.add(values());
490
- }
491
- return Array.from(results);
492
- }
493
- };
494
- var faker = {
495
- //
496
- // Util
497
- //
498
- seed: (value) => (0, import_falso.seed)(String(value)),
499
- helpers: {
500
- arrayElement: (a) => (0, import_falso.rand)(a),
501
- multiple: (f, { count }) => multiple(f, typeof count === "number" ? count : getCount(count)),
502
- uniqueArray: (f, n) => uniqueArray(f, n),
503
- randomSubset: (array, count) => {
504
- const length = count === void 0 ? Math.floor(Math.random() * (array.length + 1)) : Math.min(typeof count === "number" ? count : getCount(count), array.length);
505
- if (length === 0) {
506
- return [];
507
- }
508
- return uniqueArray(() => (0, import_falso.rand)(array), length);
509
- }
510
- },
511
- //
512
- // Type
513
- //
514
- number: {
515
- float: (range) => (0, import_falso.randFloat)(range ? toRange(range) : void 0),
516
- int: (range) => (0, import_falso.randNumber)(range ? toRange(range) : void 0)
517
- },
518
- datatype: {
519
- boolean: (p) => (0, import_falso.randChanceBoolean)({
520
- chanceTrue: p?.probability ?? 0.5
521
- })
522
- },
523
- date: {
524
- recent: () => (0, import_falso.randRecentDate)(),
525
- iso8601: () => (0, import_falso.randRecentDate)().toISOString()
526
- },
527
- image: {
528
- url: () => (0, import_falso.randImg)()
529
- },
530
- //
531
- // Text
532
- //
533
- lorem: {
534
- word: () => (0, import_falso.randWord)(),
535
- words: (n = 1) => (0, import_falso.randWord)({
536
- length: getCount(n)
537
- }).join(" "),
538
- sentence: (n = 1) => {
539
- if (n) {
540
- const text = (0, import_falso.randWord)({
541
- length: getCount(n)
542
- }).join(" ");
543
- return text.charAt(0).toUpperCase() + text.slice(1) + ".";
544
- }
545
- return (0, import_falso.randSentence)();
546
- },
547
- sentences: (n = 1) => (0, import_falso.randSentence)({
548
- length: getCount(n)
549
- }).join(" "),
550
- paragraph: (n = 1) => {
551
- if (n) {
552
- return (0, import_falso.randSentence)({
553
- length: getCount(n)
554
- }).join(" ");
555
- }
556
- return (0, import_falso.randParagraph)();
557
- },
558
- paragraphs: (n = 1) => (0, import_falso.randParagraph)({
559
- length: getCount(n)
560
- }).join("\n")
561
- },
562
- //
563
- // String
564
- //
565
- string: {
566
- hexadecimal: (l) => (0, import_falso.randHexaDecimal)(l).join(""),
567
- uuid: () => (0, import_falso.randUuid)()
568
- },
569
- //
570
- // Custom
571
- //
572
- internet: {
573
- email: () => (0, import_falso.randEmail)(),
574
- url: () => (0, import_falso.randUrl)()
575
- },
576
- person: {
577
- firstName: () => (0, import_falso.randFirstName)(),
578
- fullName: () => (0, import_falso.randFullName)()
579
- },
580
- company: {
581
- name: () => (0, import_falso.randCompanyName)()
582
- },
583
- commerce: {
584
- productName: () => (0, import_falso.randProductName)()
585
- },
586
- geo: {
587
- airport: () => (0, import_falso.rand)(airports),
588
- location: () => (0, import_falso.rand)(airports).location
589
- },
590
- email: {},
591
- properties: {
592
- emoji: () => (0, import_falso.rand)(import_util.idEmoji),
593
- hue: () => (0, import_falso.rand)(import_util.idHue),
594
- icon: () => (0, import_falso.rand)(icons)
595
- }
596
- };
597
- // Annotate the CommonJS export names for ESM import in node:
598
- 0 && (module.exports = {
599
- faker,
600
- ...require("@ngneat/falso")
601
- });
602
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/index.ts", "../../../src/faker.ts", "../../../src/data.ts", "../../../src/util.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport * from '@ngneat/falso';\n\nexport * from './faker';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n rand,\n randChanceBoolean,\n randCompanyName,\n randEmail,\n randFirstName,\n randFloat,\n randFullName,\n randHexaDecimal,\n randImg,\n randNumber,\n randParagraph,\n randProductName,\n randRecentDate,\n randSentence,\n randUrl,\n randUuid,\n randWord,\n seed,\n} from '@ngneat/falso';\n\nimport { idEmoji, idHue } from '@dxos/util';\n\nimport { airports, icons } from './data';\nimport { type Range, getCount, multiple, toRange, uniqueArray } from './util';\n\n// Fake faker.\nexport const faker = {\n //\n // Util\n //\n seed: (value: number) => seed(String(value)),\n helpers: {\n arrayElement: <T>(a: T[]) => rand(a),\n multiple: <T>(f: () => T, { count }: { count: number | { min: number; max: number } }) =>\n multiple(f, typeof count === 'number' ? count : getCount(count)),\n uniqueArray: <T>(f: T[] | (() => T), n: number) => uniqueArray(f, n),\n randomSubset: <T>(array: T[], count?: number | { min: number; max: number }) => {\n const length =\n count === undefined\n ? Math.floor(Math.random() * (array.length + 1))\n : Math.min(typeof count === 'number' ? count : getCount(count), array.length);\n\n if (length === 0) {\n return [];\n }\n return uniqueArray(() => rand(array), length);\n },\n },\n\n //\n // Type\n //\n number: {\n float: (range?: number | Range) => randFloat(range ? toRange(range) : undefined),\n int: (range?: number | Range) => randNumber(range ? toRange(range) : undefined),\n },\n datatype: {\n boolean: (p?: { probability: number }) => randChanceBoolean({ chanceTrue: p?.probability ?? 0.5 }),\n },\n date: {\n recent: () => randRecentDate(),\n iso8601: () => randRecentDate().toISOString(),\n },\n image: {\n url: () => randImg(),\n },\n\n //\n // Text\n //\n lorem: {\n word: () => randWord(),\n words: (n: number | Range = 1) => randWord({ length: getCount(n) }).join(' '),\n sentence: (n: number | Range = 1) => {\n if (n) {\n const text = randWord({ length: getCount(n) }).join(' ');\n return text.charAt(0).toUpperCase() + text.slice(1) + '.';\n }\n\n return randSentence();\n },\n sentences: (n: number | Range = 1) => randSentence({ length: getCount(n) }).join(' '),\n paragraph: (n: number | Range = 1) => {\n if (n) {\n return randSentence({ length: getCount(n) }).join(' ');\n }\n\n return randParagraph();\n },\n paragraphs: (n: number | Range = 1) => randParagraph({ length: getCount(n) }).join('\\n'),\n },\n\n //\n // String\n //\n string: {\n hexadecimal: (l?: { length: number }) => randHexaDecimal(l).join(''),\n uuid: () => randUuid(),\n },\n\n //\n // Custom\n //\n internet: {\n email: () => randEmail(),\n url: () => randUrl(),\n },\n person: {\n firstName: () => randFirstName(),\n fullName: () => randFullName(),\n },\n company: {\n name: () => randCompanyName(),\n },\n commerce: {\n productName: () => randProductName(),\n },\n geo: {\n airport: () => rand(airports),\n location: () => rand(airports).location,\n },\n email: {},\n properties: {\n emoji: () => rand(idEmoji),\n hue: () => rand(idHue),\n icon: () => rand(icons),\n },\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const airports = [\n { name: 'Atlanta', code: 'ATL', location: [-84.4277, 33.6407] },\n { name: 'Dubai', code: 'DXB', location: [55.3644, 25.2532] },\n { name: 'Dallas', code: 'DFW', location: [-97.0403, 32.8998] },\n { name: 'London', code: 'LHR', location: [-0.4543, 51.47] },\n { name: 'Tokyo', code: 'HND', location: [139.7811, 35.5494] },\n { name: 'Denver', code: 'DEN', location: [-104.6737, 39.8561] },\n { name: 'Istanbul', code: 'IST', location: [28.8153, 41.2753] },\n { name: 'Los Angeles', code: 'LAX', location: [-118.4085, 33.9416] },\n { name: 'Paris', code: 'CDG', location: [2.55, 49.0097] },\n { name: 'Guangzhou', code: 'CAN', location: [113.2971, 23.3924] },\n { name: 'Frankfurt', code: 'FRA', location: [8.5706, 50.0333] },\n { name: 'Delhi', code: 'DEL', location: [77.1031, 28.5562] },\n { name: 'Singapore', code: 'SIN', location: [103.994, 1.3644] },\n { name: 'Amsterdam', code: 'AMS', location: [4.7639, 52.3105] },\n { name: 'Seoul', code: 'ICN', location: [126.4505, 37.4602] },\n { name: 'Jakarta', code: 'CGK', location: [106.6559, -6.1256] },\n { name: 'Bangkok', code: 'BKK', location: [100.7501, 13.6899] },\n { name: 'Hong Kong', code: 'HKG', location: [113.9185, 22.308] },\n { name: 'Madrid', code: 'MAD', location: [-3.5676, 40.4936] },\n { name: 'San Francisco', code: 'SFO', location: [-122.379, 37.6213] },\n { name: 'New York', code: 'JFK', location: [-73.7781, 40.6413] },\n { name: 'Chicago', code: 'ORD', location: [-87.9048, 41.9742] },\n { name: 'Shanghai', code: 'PVG', location: [121.8083, 31.1434] },\n { name: 'Beijing', code: 'PEK', location: [116.4074, 39.9042] },\n { name: 'Miami', code: 'MIA', location: [-80.2906, 25.7959] },\n { name: 'Houston', code: 'IAH', location: [-95.3414, 29.9844] },\n { name: 'Munich', code: 'MUC', location: [11.7861, 48.3538] },\n { name: 'Toronto', code: 'YYZ', location: [-79.6306, 43.6777] },\n { name: 'Sydney', code: 'SYD', location: [151.1799, -33.9399] },\n { name: 'Melbourne', code: 'MEL', location: [144.843, -37.6733] },\n { name: 'Rome', code: 'FCO', location: [12.2508, 41.8003] },\n { name: 'Barcelona', code: 'BCN', location: [2.0759, 41.2974] },\n { name: 'Kuala Lumpur', code: 'KUL', location: [101.7099, 2.7456] },\n { name: 'Doha', code: 'DOH', location: [51.6136, 25.2731] },\n { name: 'Vienna', code: 'VIE', location: [16.5697, 48.1103] },\n { name: 'Zurich', code: 'ZRH', location: [8.5492, 47.4583] },\n { name: 'Brussels', code: 'BRU', location: [4.4844, 50.901] },\n { name: 'Copenhagen', code: 'CPH', location: [12.6508, 55.6181] },\n { name: 'Oslo', code: 'OSL', location: [11.1004, 60.1939] },\n { name: 'Stockholm', code: 'ARN', location: [17.9186, 59.6519] },\n { name: 'Helsinki', code: 'HEL', location: [24.9633, 60.3172] },\n { name: 'Lisbon', code: 'LIS', location: [-9.1359, 38.7742] },\n { name: 'Athens', code: 'ATH', location: [23.9445, 37.9364] },\n { name: 'Warsaw', code: 'WAW', location: [20.9671, 52.1657] },\n { name: 'Budapest', code: 'BUD', location: [19.261, 47.433] },\n { name: 'Prague', code: 'PRG', location: [14.2632, 50.1008] },\n { name: 'Moscow', code: 'SVO', location: [37.4146, 55.9726] },\n { name: 'Dubai', code: 'DXB', location: [55.3644, 25.2532] },\n];\n\nexport const icons = [\n 'ph--air-traffic-control--regular',\n 'ph--asterisk--regular',\n 'ph--atom--regular',\n 'ph--basketball--regular',\n 'ph--butterfly--regular',\n 'ph--cactus--regular',\n 'ph--cake--regular',\n 'ph--calendar-dots--regular',\n 'ph--campfire--regular',\n 'ph--command--regular',\n 'ph--confetti--regular',\n 'ph--detective--regular',\n 'ph--disco-ball--regular',\n 'ph--dna--regular',\n 'ph--factory--regular',\n 'ph--flag-banner-fold--regular',\n 'ph--flask--regular',\n 'ph--flower-lotus--regular',\n 'ph--flying-saucer--regular',\n 'ph--game-controller--regular',\n 'ph--gavel--regular',\n 'ph--gift--regular',\n 'ph--guitar--regular',\n 'ph--hamburger--regular',\n 'ph--handshake--regular',\n 'ph--heart--regular',\n 'ph--lightbulb--regular',\n 'ph--lock--regular',\n 'ph--martini--regular',\n 'ph--medal-military--regular',\n 'ph--moped-front--regular',\n 'ph--office-chair--regular',\n 'ph--paint-brush-household--regular',\n 'ph--peace--regular',\n 'ph--person-simple-hike--regular',\n 'ph--piggy-bank--regular',\n 'ph--potted-plant--regular',\n 'ph--radioactive--regular',\n 'ph--rocket-launch--regular',\n 'ph--shield-star--regular',\n 'ph--shopping-cart--regular',\n 'ph--stethoscope--regular',\n 'ph--student--regular',\n 'ph--sun--regular',\n 'ph--tote--regular',\n 'ph--tree--regular',\n 'ph--users-three--regular',\n 'ph--yin-yang--regular',\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { randNumber } from '@ngneat/falso';\n\nexport type Range = { min?: number; max?: number; count?: number };\n\nexport const toRange = (range: number | Range, min = 0) => (typeof range === 'number' ? { min, max: range } : range);\n\nexport const getCount = (range?: number | Range) => (typeof range === 'number' ? range : randNumber(range));\n\nexport const multiple = <T>(fn: (i: number) => T, n: number): T[] => {\n return Array.from({ length: n }).map((_, i) => fn(i));\n};\n\nexport const uniqueArray = <T>(values: T[] | (() => T), n: number): T[] => {\n if (Array.isArray(values)) {\n const results: T[] = [];\n const selection = Array.from(new Set<T>(values));\n for (let i = 0; i < n; i++) {\n if (selection.length === 0) {\n break;\n }\n results.push(selection.splice(Math.floor(Math.random() * selection.length), 1)[0]);\n }\n return results;\n } else {\n const results = new Set<T>();\n // TODO(burdon): Set timeout.\n while (results.size < n) {\n results.add(values());\n }\n\n return Array.from(results);\n }\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAc;ACAd,mBAmBO;AAEP,kBAA+B;AErB/B,IAAAA,gBAA2B;ADApB,IAAMC,WAAW;EACtB;IAAEC,MAAM;IAAWC,MAAM;IAAOC,UAAU;MAAC;MAAU;;EAAS;EAC9D;IAAEF,MAAM;IAASC,MAAM;IAAOC,UAAU;MAAC;MAAS;;EAAS;EAC3D;IAAEF,MAAM;IAAUC,MAAM;IAAOC,UAAU;MAAC;MAAU;;EAAS;EAC7D;IAAEF,MAAM;IAAUC,MAAM;IAAOC,UAAU;MAAC;MAAS;;EAAO;EAC1D;IAAEF,MAAM;IAASC,MAAM;IAAOC,UAAU;MAAC;MAAU;;EAAS;EAC5D;IAAEF,MAAM;IAAUC,MAAM;IAAOC,UAAU;MAAC;MAAW;;EAAS;EAC9D;IAAEF,MAAM;IAAYC,MAAM;IAAOC,UAAU;MAAC;MAAS;;EAAS;EAC9D;IAAEF,MAAM;IAAeC,MAAM;IAAOC,UAAU;MAAC;MAAW;;EAAS;EACnE;IAAEF,MAAM;IAASC,MAAM;IAAOC,UAAU;MAAC;MAAM;;EAAS;EACxD;IAAEF,MAAM;IAAaC,MAAM;IAAOC,UAAU;MAAC;MAAU;;EAAS;EAChE;IAAEF,MAAM;IAAaC,MAAM;IAAOC,UAAU;MAAC;MAAQ;;EAAS;EAC9D;IAAEF,MAAM;IAASC,MAAM;IAAOC,UAAU;MAAC;MAAS;;EAAS;EAC3D;IAAEF,MAAM;IAAaC,MAAM;IAAOC,UAAU;MAAC;MAAS;;EAAQ;EAC9D;IAAEF,MA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;IACAC,WAAW,CAAC9D,IAAoB,UAAM6D,2BAAa;MAAE1D,QAAQP,SAASI,CAAAA;IAAG,CAAA,EAAGuD,KAAK,GAAA;IACjFQ,WAAW,CAAC/D,IAAoB,MAAC;AAC/B,UAAIA,GAAG;AACL,mBAAO6D,2BAAa;UAAE1D,QAAQP,SAASI,CAAAA;QAAG,CAAA,EAAGuD,KAAK,GAAA;MACpD;AAEA,iBAAOS,4BAAAA;IACT;IACAC,YAAY,CAACjE,IAAoB,UAAMgE,4BAAc;MAAE7D,QAAQP,SAASI,CAAAA;IAAG,CAAA,EAAGuD,KAAK,IAAA;EACrF;;;;EAKAW,QAAQ;IACNC,aAAa,CAACC,UAA2BC,8BAAgBD,CAAAA,EAAGb,KAAK,EAAA;IACjEe,MAAM,UAAMC,uBAAAA;EACd;;;;EAKAC,UAAU;IACRC,OAAO,UAAMC,wBAAAA;IACbzB,KAAK,UAAM0B,sBAAAA;EACb;EACAC,QAAQ;IACNC,WAAW,UAAMC,4BAAAA;IACjBC,UAAU,UAAMC,2BAAAA;EAClB;EACAC,SAAS;IACP7F,MAAM,UAAM8F,8BAAAA;EACd;EACAC,UAAU;IACRC,aAAa,UAAMC,8BAAAA;EACrB;EACAC,KAAK;IACHC,SAAS,UAAM5D,mBAAKxC,QAAAA;IACpBG,UAAU,UAAMqC,mBAAKxC,QAAAA,EAAUG;EACjC;EACAmF,OAAO,CAAC;EACRe,YAAY;IACVC,OAAO,UAAM9D,mBAAK+D,mBAAAA;IAClBC,KAAK,UAAMhE,mBAAKiE,iBAAAA;IAChBC,MAAM,UAAMlE,mBAAKpC,KAAAA;EACnB;AACF;",
6
- "names": ["import_falso", "airports", "name", "code", "location", "icons", "toRange", "range", "min", "max", "getCount", "randNumber", "multiple", "fn", "n", "Array", "from", "length", "map", "_", "i", "uniqueArray", "values", "isArray", "results", "selection", "Set", "push", "splice", "Math", "floor", "random", "size", "add", "faker", "seed", "value", "String", "helpers", "arrayElement", "a", "rand", "f", "count", "randomSubset", "array", "undefined", "number", "float", "randFloat", "int", "datatype", "boolean", "p", "randChanceBoolean", "chanceTrue", "probability", "date", "recent", "randRecentDate", "iso8601", "toISOString", "image", "url", "randImg", "lorem", "word", "randWord", "words", "join", "sentence", "text", "charAt", "toUpperCase", "slice", "randSentence", "sentences", "paragraph", "randParagraph", "paragraphs", "string", "hexadecimal", "l", "randHexaDecimal", "uuid", "randUuid", "internet", "email", "randEmail", "randUrl", "person", "firstName", "randFirstName", "fullName", "randFullName", "company", "randCompanyName", "commerce", "productName", "randProductName", "geo", "airport", "properties", "emoji", "idEmoji", "hue", "idHue", "icon"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"packages/common/random/src/data.ts":{"bytes":18733,"imports":[],"format":"esm"},"packages/common/random/src/util.ts":{"bytes":4206,"imports":[{"path":"@ngneat/falso","kind":"import-statement","external":true}],"format":"esm"},"packages/common/random/src/faker.ts":{"bytes":12344,"imports":[{"path":"@ngneat/falso","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/common/random/src/data.ts","kind":"import-statement","original":"./data"},{"path":"packages/common/random/src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/common/random/src/index.ts":{"bytes":558,"imports":[{"path":"@ngneat/falso","kind":"import-statement","external":true},{"path":"packages/common/random/src/faker.ts","kind":"import-statement","original":"./faker"}],"format":"esm"}},"outputs":{"packages/common/random/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17019},"packages/common/random/dist/lib/node/index.cjs":{"imports":[{"path":"@ngneat/falso","kind":"import-statement","external":true},{"path":"@ngneat/falso","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@ngneat/falso","kind":"import-statement","external":true}],"exports":["faker"],"entryPoint":"packages/common/random/src/index.ts","inputs":{"packages/common/random/src/index.ts":{"bytesInOutput":31},"packages/common/random/src/faker.ts":{"bytesInOutput":2676},"packages/common/random/src/data.ts":{"bytesInOutput":6106},"packages/common/random/src/util.ts":{"bytesInOutput":827}},"bytes":9892}}}