@vielzeug/illusionist 26.11.5 → 26.11.6
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/README.md +7 -7
- package/dist/_helpers/boolean.js +1 -2
- package/dist/_helpers/float.js +1 -2
- package/dist/_helpers/int.js +1 -2
- package/dist/_helpers/string.js +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/commerce/commerce.js +1 -2
- package/dist/commerce/data.js +1 -2
- package/dist/date/date.js +1 -2
- package/dist/errors.js +1 -2
- package/dist/factory.js +1 -2
- package/dist/finance/data.js +1 -2
- package/dist/finance/finance.js +1 -2
- package/dist/illusionist.js +17 -34
- package/dist/illusionist.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +8 -8
- package/dist/internet/data.js +1 -2
- package/dist/internet/internet.js +1 -2
- package/dist/locales/de.js +1 -2
- package/dist/locales/en.js +1 -2
- package/dist/location/data/de.js +1 -2
- package/dist/location/data/en.js +1 -2
- package/dist/location/location.js +11 -12
- package/dist/lorem/data.js +1 -2
- package/dist/lorem/lorem.js +1 -2
- package/dist/person/data/de.js +1 -2
- package/dist/person/data/en.js +1 -2
- package/dist/person/person.cjs +1 -1
- package/dist/person/person.cjs.map +1 -1
- package/dist/person/person.js +12 -13
- package/dist/seed/create-seed.js +1 -2
- package/dist/seed/mulberry32.js +1 -2
- package/dist/system/data.js +1 -2
- package/dist/system/system.js +1 -2
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -18,14 +18,14 @@ import { en } from '@vielzeug/illusionist/locales';
|
|
|
18
18
|
|
|
19
19
|
const illusion = createIllusion({ seed: 12345, locale: en });
|
|
20
20
|
|
|
21
|
-
illusion.person.fullName();
|
|
22
|
-
illusion.internet.email();
|
|
23
|
-
illusion.commerce.price();
|
|
21
|
+
illusion.person.fullName(); // "Ashley Harris"
|
|
22
|
+
illusion.internet.email(); // "samantha.sanchez@mail.com"
|
|
23
|
+
illusion.commerce.price(); // Money<USD>
|
|
24
24
|
illusion.date.past({ years: 5 }); // Temporal.ZonedDateTime
|
|
25
|
-
illusion.finance.iban();
|
|
26
|
-
illusion.location.city();
|
|
27
|
-
illusion.lorem.paragraph();
|
|
28
|
-
illusion.system.semver();
|
|
25
|
+
illusion.finance.iban(); // "IT0649896243786776403271206"
|
|
26
|
+
illusion.location.city(); // "Denver"
|
|
27
|
+
illusion.lorem.paragraph(); // "Dolor in fugiat anim dolor aute officia irure sunt..."
|
|
28
|
+
illusion.system.semver(); // "7.4.0"
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Documentation
|
package/dist/_helpers/boolean.js
CHANGED
package/dist/_helpers/float.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nextFloat as e } from "./next-float.js";
|
|
2
|
-
|
|
2
|
+
// src/_helpers/float.ts
|
|
3
3
|
function float(t, n, r) {
|
|
4
4
|
return t > n ? t : t + e(r) * (n - t);
|
|
5
5
|
}
|
|
@@ -7,7 +7,6 @@ function floatFixed(e, t, n = 2, r) {
|
|
|
7
7
|
let i = 10 ** n, a = float(e * i, t * i, r);
|
|
8
8
|
return Math.round(a) / i;
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { float, floatFixed };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=float.js.map
|
package/dist/_helpers/int.js
CHANGED
package/dist/_helpers/string.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nextFloat as e } from "./next-float.js";
|
|
2
|
-
|
|
2
|
+
// src/_helpers/string.ts
|
|
3
3
|
function pick(t, n) {
|
|
4
4
|
return t.length === 0 ? void 0 : t[Math.floor(e(n) * t.length)];
|
|
5
5
|
}
|
|
@@ -23,7 +23,6 @@ function base58String(t, n) {
|
|
|
23
23
|
for (let i = 0; i < t; i++) r += "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"[Math.floor(e(n) * 58)];
|
|
24
24
|
return r;
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { alphanumeric, base58String, hexString, numericString, pick };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=string.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var e = Object.defineProperty, __exportAll = (t, n) => {
|
|
3
3
|
let r = {};
|
|
4
4
|
for (var i in t) e(r, i, {
|
|
@@ -7,5 +7,4 @@ var e = Object.defineProperty, __exportAll = (t, n) => {
|
|
|
7
7
|
});
|
|
8
8
|
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { __exportAll };
|
|
@@ -4,7 +4,7 @@ import { int as n } from "../_helpers/int.js";
|
|
|
4
4
|
import { pick as r } from "../_helpers/string.js";
|
|
5
5
|
import { COMMERCE_DATA as i } from "./data.js";
|
|
6
6
|
import { EUR as a, GBP as o, USD as s, money as c } from "@vielzeug/coins";
|
|
7
|
-
|
|
7
|
+
// src/commerce/commerce.ts
|
|
8
8
|
var l = /* @__PURE__ */ e({
|
|
9
9
|
department: () => department,
|
|
10
10
|
price: () => price,
|
|
@@ -45,7 +45,6 @@ function productDescription(e) {
|
|
|
45
45
|
}
|
|
46
46
|
return a.join(" ");
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { l as commerce_exports, department, price, productAdjective, productDescription, productMaterial, productName, productNoun };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=commerce.js.map
|
package/dist/commerce/data.js
CHANGED
package/dist/date/date.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { int as t } from "../_helpers/int.js";
|
|
3
3
|
import { Temporal as n } from "@vielzeug/tempo";
|
|
4
|
-
|
|
4
|
+
// src/date/date.ts
|
|
5
5
|
var r = /* @__PURE__ */ e({
|
|
6
6
|
between: () => between,
|
|
7
7
|
birthday: () => birthday,
|
|
@@ -87,7 +87,6 @@ function month(e, n) {
|
|
|
87
87
|
"December"
|
|
88
88
|
])[t(0, 11, e.source)];
|
|
89
89
|
}
|
|
90
|
-
//#endregion
|
|
91
90
|
export { between, birthday, r as date_exports, future, month, past, recent, weekday };
|
|
92
91
|
|
|
93
92
|
//# sourceMappingURL=date.js.map
|
package/dist/errors.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
2
|
var IllusionistError = class extends Error {
|
|
3
3
|
constructor(e, t) {
|
|
4
4
|
super(e, t), this.name = new.target.name, Object.setPrototypeOf(this, new.target.prototype);
|
|
5
5
|
}
|
|
6
6
|
}, IllusionistSeedError = class extends IllusionistError {};
|
|
7
|
-
//#endregion
|
|
8
7
|
export { IllusionistError, IllusionistSeedError };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=errors.js.map
|
package/dist/factory.js
CHANGED
|
@@ -7,7 +7,7 @@ import { lorem_exports as a } from "./lorem/lorem.js";
|
|
|
7
7
|
import { person_exports as o } from "./person/person.js";
|
|
8
8
|
import { createSeed as s } from "./seed/create-seed.js";
|
|
9
9
|
import { system_exports as c } from "./system/system.js";
|
|
10
|
-
|
|
10
|
+
// src/factory.ts
|
|
11
11
|
function createIllusion(l) {
|
|
12
12
|
let { locale: u, seed: d } = l, f = {
|
|
13
13
|
locale: u,
|
|
@@ -30,7 +30,6 @@ function createIllusion(l) {
|
|
|
30
30
|
system: bind(c)
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { createIllusion };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=factory.js.map
|
package/dist/finance/data.js
CHANGED
package/dist/finance/finance.js
CHANGED
|
@@ -4,7 +4,7 @@ import { int as n } from "../_helpers/int.js";
|
|
|
4
4
|
import { alphanumeric as r, base58String as i, hexString as a, numericString as o, pick as s } from "../_helpers/string.js";
|
|
5
5
|
import { FINANCE_DATA as c } from "./data.js";
|
|
6
6
|
import { EUR as l, GBP as u, USD as d, money as f } from "@vielzeug/coins";
|
|
7
|
-
|
|
7
|
+
// src/finance/finance.ts
|
|
8
8
|
var p = /* @__PURE__ */ e({
|
|
9
9
|
amount: () => amount,
|
|
10
10
|
bank: () => bank,
|
|
@@ -84,7 +84,6 @@ function transactionType(e) {
|
|
|
84
84
|
function bank(e) {
|
|
85
85
|
return s(c.banks, e.source);
|
|
86
86
|
}
|
|
87
|
-
//#endregion
|
|
88
87
|
export { amount, bank, bic, bitcoinAddress, creditCardCVV, creditCardNumber, ethereumAddress, p as finance_exports, iban, transactionType };
|
|
89
88
|
|
|
90
89
|
//# sourceMappingURL=finance.js.map
|
package/dist/illusionist.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EUR as e, GBP as t, USD as n, money as r } from "@vielzeug/coins";
|
|
2
2
|
import { random as i, randomFloat as a } from "@vielzeug/arsenal";
|
|
3
3
|
import { Temporal as o } from "@vielzeug/tempo";
|
|
4
|
-
|
|
4
|
+
// \0rolldown/runtime.js
|
|
5
5
|
var s = Object.defineProperty, __exportAll = (e, t) => {
|
|
6
6
|
let n = {};
|
|
7
7
|
for (var r in e) s(n, r, {
|
|
@@ -10,8 +10,7 @@ var s = Object.defineProperty, __exportAll = (e, t) => {
|
|
|
10
10
|
});
|
|
11
11
|
return t || s(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
//#region src/_helpers/float.ts
|
|
13
|
+
// src/_helpers/float.ts
|
|
15
14
|
function float(e, t, n) {
|
|
16
15
|
return e > t ? e : e + a(n) * (t - e);
|
|
17
16
|
}
|
|
@@ -19,13 +18,11 @@ function floatFixed(e, t, n = 2, r) {
|
|
|
19
18
|
let i = 10 ** n, a = float(e * i, t * i, r);
|
|
20
19
|
return Math.round(a) / i;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
//#region src/_helpers/int.ts
|
|
21
|
+
// src/_helpers/int.ts
|
|
24
22
|
function int(e, t, n) {
|
|
25
23
|
return i(e, t, n);
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
//#region src/_helpers/string.ts
|
|
25
|
+
// src/_helpers/string.ts
|
|
29
26
|
function pick(e, t) {
|
|
30
27
|
return e.length === 0 ? void 0 : e[Math.floor(a(t) * e.length)];
|
|
31
28
|
}
|
|
@@ -49,8 +46,7 @@ function base58String(e, t) {
|
|
|
49
46
|
for (let r = 0; r < e; r++) n += "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"[Math.floor(a(t) * 58)];
|
|
50
47
|
return n;
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
//#region src/commerce/data.ts
|
|
49
|
+
// src/commerce/data.ts
|
|
54
50
|
var c = {
|
|
55
51
|
departments: [
|
|
56
52
|
"Books",
|
|
@@ -168,8 +164,7 @@ function productDescription(e) {
|
|
|
168
164
|
}
|
|
169
165
|
return n.join(" ");
|
|
170
166
|
}
|
|
171
|
-
|
|
172
|
-
//#region src/date/date.ts
|
|
167
|
+
// src/date/date.ts
|
|
173
168
|
var d = /* @__PURE__ */ __exportAll({
|
|
174
169
|
between: () => between,
|
|
175
170
|
birthday: () => birthday,
|
|
@@ -255,8 +250,7 @@ function month(e, t) {
|
|
|
255
250
|
"December"
|
|
256
251
|
])[int(0, 11, e.source)];
|
|
257
252
|
}
|
|
258
|
-
|
|
259
|
-
//#region src/errors.ts
|
|
253
|
+
// src/errors.ts
|
|
260
254
|
var IllusionistError = class extends Error {
|
|
261
255
|
constructor(e, t) {
|
|
262
256
|
super(e, t), this.name = new.target.name, Object.setPrototypeOf(this, new.target.prototype);
|
|
@@ -392,8 +386,7 @@ function transactionType(e) {
|
|
|
392
386
|
function bank(e) {
|
|
393
387
|
return pick(f.banks, e.source);
|
|
394
388
|
}
|
|
395
|
-
|
|
396
|
-
//#region src/internet/data.ts
|
|
389
|
+
// src/internet/data.ts
|
|
397
390
|
var v = {
|
|
398
391
|
domains: [
|
|
399
392
|
"example",
|
|
@@ -585,8 +578,7 @@ function statusCode(e) {
|
|
|
585
578
|
function mimeType(e) {
|
|
586
579
|
return pick(v.mimeTypes, e.source) ?? "text/plain";
|
|
587
580
|
}
|
|
588
|
-
|
|
589
|
-
//#region src/location/location.ts
|
|
581
|
+
// src/location/location.ts
|
|
590
582
|
var S = /* @__PURE__ */ __exportAll({
|
|
591
583
|
city: () => city,
|
|
592
584
|
country: () => country,
|
|
@@ -635,8 +627,7 @@ function nearbyGPSCoordinate(e, t) {
|
|
|
635
627
|
lng: float(n.lng - 1, n.lng + 1, e.source)
|
|
636
628
|
};
|
|
637
629
|
}
|
|
638
|
-
|
|
639
|
-
//#region src/lorem/data.ts
|
|
630
|
+
// src/lorem/data.ts
|
|
640
631
|
var C = { words: /* @__PURE__ */ "lorem.ipsum.dolor.sit.amet.consectetur.adipiscing.elit.sed.do.eiusmod.tempor.incididunt.ut.labore.et.dolore.magna.aliqua.enim.ad.minim.veniam.quis.nostrud.exercitation.ullamco.laboris.nisi.aliquip.ex.ea.commodo.consequat.duis.aute.irure.in.reprehenderit.voluptate.velit.esse.cillum.fugiat.nulla.pariatur.excepteur.sint.occaecat.cupidatat.non.proident.sunt.culpa.qui.officia.deserunt.mollit.anim.id.est.laborum".split(".") }, w = /* @__PURE__ */ __exportAll({
|
|
641
632
|
lines: () => lines,
|
|
642
633
|
paragraph: () => paragraph,
|
|
@@ -682,13 +673,11 @@ function lines(e, t = 5) {
|
|
|
682
673
|
for (let r = 0; r < t; r++) n.push(sentence(e));
|
|
683
674
|
return n.join("\n");
|
|
684
675
|
}
|
|
685
|
-
|
|
686
|
-
//#region src/_helpers/boolean.ts
|
|
676
|
+
// src/_helpers/boolean.ts
|
|
687
677
|
function boolean(e, t = .5) {
|
|
688
678
|
return a(e) < t;
|
|
689
679
|
}
|
|
690
|
-
|
|
691
|
-
//#region src/person/person.ts
|
|
680
|
+
// src/person/person.ts
|
|
692
681
|
var T = /* @__PURE__ */ __exportAll({
|
|
693
682
|
firstName: () => firstName,
|
|
694
683
|
fullName: () => fullName,
|
|
@@ -725,8 +714,7 @@ function jobTitle(e) {
|
|
|
725
714
|
let t = data(e);
|
|
726
715
|
return `${pick(t.jobAreas, e.source)} ${pick(t.jobTypes, e.source)}`;
|
|
727
716
|
}
|
|
728
|
-
|
|
729
|
-
//#region src/seed/mulberry32.ts
|
|
717
|
+
// src/seed/mulberry32.ts
|
|
730
718
|
function mulberry32(e) {
|
|
731
719
|
let t = e >>> 0;
|
|
732
720
|
return { next() {
|
|
@@ -735,8 +723,7 @@ function mulberry32(e) {
|
|
|
735
723
|
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
736
724
|
} };
|
|
737
725
|
}
|
|
738
|
-
|
|
739
|
-
//#region src/seed/create-seed.ts
|
|
726
|
+
// src/seed/create-seed.ts
|
|
740
727
|
function createSeed(e) {
|
|
741
728
|
if (e == null) return cryptoSource();
|
|
742
729
|
if (typeof e == "number") {
|
|
@@ -752,8 +739,7 @@ function cryptoSource() {
|
|
|
752
739
|
return crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0] / 4294967296;
|
|
753
740
|
} };
|
|
754
741
|
}
|
|
755
|
-
|
|
756
|
-
//#region src/system/data.ts
|
|
742
|
+
// src/system/data.ts
|
|
757
743
|
var E = {
|
|
758
744
|
cronExpressions: [
|
|
759
745
|
"0 * * * *",
|
|
@@ -882,8 +868,7 @@ function process(e) {
|
|
|
882
868
|
"bash"
|
|
883
869
|
], e.source)}_${alphanumeric(int(3, 8, e.source), e.source)}`;
|
|
884
870
|
}
|
|
885
|
-
|
|
886
|
-
//#region src/factory.ts
|
|
871
|
+
// src/factory.ts
|
|
887
872
|
function createIllusion(e) {
|
|
888
873
|
let { locale: t, seed: n } = e, r = {
|
|
889
874
|
locale: t,
|
|
@@ -906,8 +891,7 @@ function createIllusion(e) {
|
|
|
906
891
|
system: bind(D)
|
|
907
892
|
};
|
|
908
893
|
}
|
|
909
|
-
|
|
910
|
-
//#region src/locales/de.ts
|
|
894
|
+
// src/locales/de.ts
|
|
911
895
|
var O = {
|
|
912
896
|
code: "de",
|
|
913
897
|
location: {
|
|
@@ -1172,7 +1156,6 @@ var O = {
|
|
|
1172
1156
|
]
|
|
1173
1157
|
}
|
|
1174
1158
|
};
|
|
1175
|
-
//#endregion
|
|
1176
1159
|
export { IllusionistError, IllusionistSeedError, amount, bank, between, bic, birthday, bitcoinAddress, city, country, createIllusion, createSeed, creditCardCVV, creditCardNumber, O as de, department, domainName, email, k as en, ethereumAddress, firstName, fullName, future, gender, httpMethod, iban, ip, jobTitle, lastName, latitude, lines, longitude, mac, mimeType, month, mulberry32, nearbyGPSCoordinate, paragraph, paragraphs, password, past, prefix, price, productAdjective, productDescription, productMaterial, productName, productNoun, recent, sentence, sentences, slug, state, statusCode, street, streetAddress, suffix, transactionType, url, userAgent, username, weekday, word, words, zipCode };
|
|
1177
1160
|
|
|
1178
1161
|
//# sourceMappingURL=illusionist.js.map
|