mimic-data 1.0.1 → 1.0.3
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/index.js +45 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +54 -54
package/dist/index.js
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2
18
|
|
|
3
|
-
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
Mimic: () => Mimic,
|
|
23
|
+
Random: () => Random,
|
|
24
|
+
createMimic: () => createMimic,
|
|
25
|
+
default: () => index_default,
|
|
26
|
+
getAllLocaleCodes: () => getAllLocaleCodes,
|
|
27
|
+
getAvailableLocales: () => getAvailableLocales,
|
|
28
|
+
localeRegistry: () => localeRegistry,
|
|
29
|
+
locales: () => locales
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(index_exports);
|
|
4
32
|
|
|
5
33
|
// src/core/random.ts
|
|
6
34
|
var Random = class {
|
|
@@ -44,6 +72,7 @@ var Random = class {
|
|
|
44
72
|
|
|
45
73
|
// src/core/mimic.ts
|
|
46
74
|
var Mimic = class {
|
|
75
|
+
locale;
|
|
47
76
|
constructor(locale) {
|
|
48
77
|
this.locale = locale;
|
|
49
78
|
}
|
|
@@ -75,8 +104,8 @@ var Mimic = class {
|
|
|
75
104
|
return Random.pick(["male", "female"]);
|
|
76
105
|
},
|
|
77
106
|
age: (range) => {
|
|
78
|
-
const min = range
|
|
79
|
-
const max = range
|
|
107
|
+
const min = (range == null ? void 0 : range.min) ?? 18;
|
|
108
|
+
const max = (range == null ? void 0 : range.max) ?? 65;
|
|
80
109
|
return Random.int(min, max);
|
|
81
110
|
},
|
|
82
111
|
dateOfBirth: (range) => {
|
|
@@ -231,10 +260,8 @@ var Mimic = class {
|
|
|
231
260
|
|
|
232
261
|
// src/core/registry.ts
|
|
233
262
|
var LocaleRegistry = class {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
this.aliases = /* @__PURE__ */ new Map();
|
|
237
|
-
}
|
|
263
|
+
locales = /* @__PURE__ */ new Map();
|
|
264
|
+
aliases = /* @__PURE__ */ new Map();
|
|
238
265
|
/**
|
|
239
266
|
* Register locale baru
|
|
240
267
|
* @param code - Kode locale utama (contoh: 'en_US')
|
|
@@ -10460,14 +10487,14 @@ var locales = {
|
|
|
10460
10487
|
he_IL
|
|
10461
10488
|
};
|
|
10462
10489
|
var index_default = createMimic;
|
|
10463
|
-
|
|
10464
|
-
exports
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10490
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
10491
|
+
0 && (module.exports = {
|
|
10492
|
+
Mimic,
|
|
10493
|
+
Random,
|
|
10494
|
+
createMimic,
|
|
10495
|
+
getAllLocaleCodes,
|
|
10496
|
+
getAvailableLocales,
|
|
10497
|
+
localeRegistry,
|
|
10498
|
+
locales
|
|
10499
|
+
});
|
|
10473
10500
|
//# sourceMappingURL=index.js.map
|