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 CHANGED
@@ -1,6 +1,34 @@
1
- 'use strict';
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
- Object.defineProperty(exports, '__esModule', { value: true });
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?.min ?? 18;
79
- const max = range?.max ?? 65;
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
- constructor() {
235
- this.locales = /* @__PURE__ */ new Map();
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.Mimic = Mimic;
10465
- exports.Random = Random;
10466
- exports.createMimic = createMimic;
10467
- exports.default = index_default;
10468
- exports.getAllLocaleCodes = getAllLocaleCodes;
10469
- exports.getAvailableLocales = getAvailableLocales;
10470
- exports.localeRegistry = localeRegistry;
10471
- exports.locales = locales;
10472
- //# sourceMappingURL=index.js.map
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