@vielzeug/illusionist 2.2.0
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 +89 -0
- package/dist/_dev.d.ts +2 -0
- package/dist/_dev.d.ts.map +1 -0
- package/dist/_helpers/boolean.cjs +2 -0
- package/dist/_helpers/boolean.cjs.map +1 -0
- package/dist/_helpers/boolean.d.ts +4 -0
- package/dist/_helpers/boolean.d.ts.map +1 -0
- package/dist/_helpers/boolean.js +8 -0
- package/dist/_helpers/boolean.js.map +1 -0
- package/dist/_helpers/float.cjs +2 -0
- package/dist/_helpers/float.cjs.map +1 -0
- package/dist/_helpers/float.d.ts +9 -0
- package/dist/_helpers/float.d.ts.map +1 -0
- package/dist/_helpers/float.js +14 -0
- package/dist/_helpers/float.js.map +1 -0
- package/dist/_helpers/int.cjs +2 -0
- package/dist/_helpers/int.cjs.map +1 -0
- package/dist/_helpers/int.d.ts +4 -0
- package/dist/_helpers/int.d.ts.map +1 -0
- package/dist/_helpers/int.js +9 -0
- package/dist/_helpers/int.js.map +1 -0
- package/dist/_helpers/string.cjs +2 -0
- package/dist/_helpers/string.cjs.map +1 -0
- package/dist/_helpers/string.d.ts +12 -0
- package/dist/_helpers/string.d.ts.map +1 -0
- package/dist/_helpers/string.js +38 -0
- package/dist/_helpers/string.js.map +1 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/commerce/commerce.cjs +2 -0
- package/dist/commerce/commerce.cjs.map +1 -0
- package/dist/commerce/commerce.d.ts +15 -0
- package/dist/commerce/commerce.d.ts.map +1 -0
- package/dist/commerce/commerce.js +51 -0
- package/dist/commerce/commerce.js.map +1 -0
- package/dist/commerce/data.cjs +2 -0
- package/dist/commerce/data.cjs.map +1 -0
- package/dist/commerce/data.d.ts +7 -0
- package/dist/commerce/data.d.ts.map +1 -0
- package/dist/commerce/data.js +83 -0
- package/dist/commerce/data.js.map +1 -0
- package/dist/commerce/index.cjs +1 -0
- package/dist/commerce/index.d.ts +2 -0
- package/dist/commerce/index.d.ts.map +1 -0
- package/dist/commerce/index.js +2 -0
- package/dist/date/date.cjs +2 -0
- package/dist/date/date.cjs.map +1 -0
- package/dist/date/date.d.ts +43 -0
- package/dist/date/date.d.ts.map +1 -0
- package/dist/date/date.js +93 -0
- package/dist/date/date.js.map +1 -0
- package/dist/date/index.cjs +1 -0
- package/dist/date/index.d.ts +2 -0
- package/dist/date/index.d.ts.map +1 -0
- package/dist/date/index.js +2 -0
- package/dist/errors.cjs +2 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +10 -0
- package/dist/errors.js.map +1 -0
- package/dist/factory.cjs +2 -0
- package/dist/factory.cjs.map +1 -0
- package/dist/factory.d.ts +46 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +46 -0
- package/dist/factory.js.map +1 -0
- package/dist/finance/data.cjs +2 -0
- package/dist/finance/data.cjs.map +1 -0
- package/dist/finance/data.d.ts +32 -0
- package/dist/finance/data.d.ts.map +1 -0
- package/dist/finance/data.js +60 -0
- package/dist/finance/data.js.map +1 -0
- package/dist/finance/finance.cjs +2 -0
- package/dist/finance/finance.cjs.map +1 -0
- package/dist/finance/finance.d.ts +20 -0
- package/dist/finance/finance.d.ts.map +1 -0
- package/dist/finance/finance.js +90 -0
- package/dist/finance/finance.js.map +1 -0
- package/dist/finance/index.cjs +1 -0
- package/dist/finance/index.d.ts +2 -0
- package/dist/finance/index.d.ts.map +1 -0
- package/dist/finance/index.js +2 -0
- package/dist/iife-entry.d.ts +4 -0
- package/dist/iife-entry.d.ts.map +1 -0
- package/dist/illusionist.cjs +4 -0
- package/dist/illusionist.cjs.map +1 -0
- package/dist/illusionist.iife.js +4 -0
- package/dist/illusionist.iife.js.map +1 -0
- package/dist/illusionist.js +4 -0
- package/dist/illusionist.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/internet/data.cjs +2 -0
- package/dist/internet/data.cjs.map +1 -0
- package/dist/internet/data.d.ts +10 -0
- package/dist/internet/data.d.ts.map +1 -0
- package/dist/internet/data.js +84 -0
- package/dist/internet/data.js.map +1 -0
- package/dist/internet/index.cjs +1 -0
- package/dist/internet/index.d.ts +2 -0
- package/dist/internet/index.d.ts.map +1 -0
- package/dist/internet/index.js +2 -0
- package/dist/internet/internet.cjs +2 -0
- package/dist/internet/internet.cjs.map +1 -0
- package/dist/internet/internet.d.ts +31 -0
- package/dist/internet/internet.d.ts.map +1 -0
- package/dist/internet/internet.js +121 -0
- package/dist/internet/internet.js.map +1 -0
- package/dist/locales/de.cjs +2 -0
- package/dist/locales/de.cjs.map +1 -0
- package/dist/locales/de.d.ts +22 -0
- package/dist/locales/de.d.ts.map +1 -0
- package/dist/locales/de.js +12 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.cjs +2 -0
- package/dist/locales/en.cjs.map +1 -0
- package/dist/locales/en.d.ts +22 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/en.js +12 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/index.cjs +1 -0
- package/dist/locales/index.d.ts +3 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/index.js +3 -0
- package/dist/location/data/de.cjs +2 -0
- package/dist/location/data/de.cjs.map +1 -0
- package/dist/location/data/de.d.ts +9 -0
- package/dist/location/data/de.d.ts.map +1 -0
- package/dist/location/data/de.js +82 -0
- package/dist/location/data/de.js.map +1 -0
- package/dist/location/data/en.cjs +2 -0
- package/dist/location/data/en.cjs.map +1 -0
- package/dist/location/data/en.d.ts +9 -0
- package/dist/location/data/en.d.ts.map +1 -0
- package/dist/location/data/en.js +65 -0
- package/dist/location/data/en.js.map +1 -0
- package/dist/location/index.cjs +1 -0
- package/dist/location/index.d.ts +2 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +2 -0
- package/dist/location/location.cjs +2 -0
- package/dist/location/location.cjs.map +1 -0
- package/dist/location/location.d.ts +28 -0
- package/dist/location/location.d.ts.map +1 -0
- package/dist/location/location.js +56 -0
- package/dist/location/location.js.map +1 -0
- package/dist/lorem/data.cjs +2 -0
- package/dist/lorem/data.cjs.map +1 -0
- package/dist/lorem/data.d.ts +5 -0
- package/dist/lorem/data.d.ts.map +1 -0
- package/dist/lorem/data.js +6 -0
- package/dist/lorem/data.js.map +1 -0
- package/dist/lorem/index.cjs +1 -0
- package/dist/lorem/index.d.ts +2 -0
- package/dist/lorem/index.d.ts.map +1 -0
- package/dist/lorem/index.js +2 -0
- package/dist/lorem/lorem.cjs +4 -0
- package/dist/lorem/lorem.cjs.map +1 -0
- package/dist/lorem/lorem.d.ts +18 -0
- package/dist/lorem/lorem.d.ts.map +1 -0
- package/dist/lorem/lorem.js +54 -0
- package/dist/lorem/lorem.js.map +1 -0
- package/dist/person/data/de.cjs +2 -0
- package/dist/person/data/de.cjs.map +1 -0
- package/dist/person/data/de.d.ts +12 -0
- package/dist/person/data/de.d.ts.map +1 -0
- package/dist/person/data/de.js +62 -0
- package/dist/person/data/de.js.map +1 -0
- package/dist/person/data/en.cjs +2 -0
- package/dist/person/data/en.cjs.map +1 -0
- package/dist/person/data/en.d.ts +12 -0
- package/dist/person/data/en.d.ts.map +1 -0
- package/dist/person/data/en.js +70 -0
- package/dist/person/data/en.js.map +1 -0
- package/dist/person/index.cjs +1 -0
- package/dist/person/index.d.ts +2 -0
- package/dist/person/index.d.ts.map +1 -0
- package/dist/person/index.js +2 -0
- package/dist/person/person.cjs +2 -0
- package/dist/person/person.cjs.map +1 -0
- package/dist/person/person.d.ts +9 -0
- package/dist/person/person.d.ts.map +1 -0
- package/dist/person/person.js +44 -0
- package/dist/person/person.js.map +1 -0
- package/dist/seed/create-seed.cjs +2 -0
- package/dist/seed/create-seed.cjs.map +1 -0
- package/dist/seed/create-seed.d.ts +17 -0
- package/dist/seed/create-seed.d.ts.map +1 -0
- package/dist/seed/create-seed.js +23 -0
- package/dist/seed/create-seed.js.map +1 -0
- package/dist/seed/index.cjs +1 -0
- package/dist/seed/index.d.ts +3 -0
- package/dist/seed/index.d.ts.map +1 -0
- package/dist/seed/index.js +3 -0
- package/dist/seed/mulberry32.cjs +2 -0
- package/dist/seed/mulberry32.cjs.map +1 -0
- package/dist/seed/mulberry32.d.ts +12 -0
- package/dist/seed/mulberry32.d.ts.map +1 -0
- package/dist/seed/mulberry32.js +13 -0
- package/dist/seed/mulberry32.js.map +1 -0
- package/dist/system/data.cjs +2 -0
- package/dist/system/data.cjs.map +1 -0
- package/dist/system/data.d.ts +29 -0
- package/dist/system/data.d.ts.map +1 -0
- package/dist/system/data.js +76 -0
- package/dist/system/data.js.map +1 -0
- package/dist/system/index.cjs +1 -0
- package/dist/system/index.d.ts +2 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/index.js +2 -0
- package/dist/system/system.cjs +2 -0
- package/dist/system/system.cjs.map +1 -0
- package/dist/system/system.d.ts +32 -0
- package/dist/system/system.d.ts.map +1 -0
- package/dist/system/system.js +70 -0
- package/dist/system/system.js.map +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +155 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { int as t } from "../_helpers/int.js";
|
|
3
|
+
import { alphanumeric as n, hexString as r, pick as i } from "../_helpers/string.js";
|
|
4
|
+
import { INTERNET_DATA as a } from "./data.js";
|
|
5
|
+
//#region src/internet/internet.ts
|
|
6
|
+
var o = /* @__PURE__ */ e({
|
|
7
|
+
domainName: () => p,
|
|
8
|
+
email: () => l,
|
|
9
|
+
httpMethod: () => _,
|
|
10
|
+
ip: () => m,
|
|
11
|
+
mac: () => h,
|
|
12
|
+
mimeType: () => y,
|
|
13
|
+
password: () => d,
|
|
14
|
+
statusCode: () => v,
|
|
15
|
+
url: () => f,
|
|
16
|
+
userAgent: () => g,
|
|
17
|
+
username: () => u
|
|
18
|
+
}), s = "!@#$%^&*()_+-=[]{}|;:,.<>?", c = [
|
|
19
|
+
"api",
|
|
20
|
+
"v1",
|
|
21
|
+
"v2",
|
|
22
|
+
"users",
|
|
23
|
+
"posts",
|
|
24
|
+
"comments",
|
|
25
|
+
"articles",
|
|
26
|
+
"products",
|
|
27
|
+
"orders",
|
|
28
|
+
"items",
|
|
29
|
+
"search",
|
|
30
|
+
"auth",
|
|
31
|
+
"login",
|
|
32
|
+
"logout",
|
|
33
|
+
"profile",
|
|
34
|
+
"settings",
|
|
35
|
+
"dashboard",
|
|
36
|
+
"files",
|
|
37
|
+
"images",
|
|
38
|
+
"assets",
|
|
39
|
+
"static",
|
|
40
|
+
"public",
|
|
41
|
+
"private",
|
|
42
|
+
"admin",
|
|
43
|
+
"reports"
|
|
44
|
+
];
|
|
45
|
+
function l(e) {
|
|
46
|
+
return `${(i(e.locale.person.firstNameFemale, e.source) ?? i(e.locale.person.firstNameMale, e.source) ?? "user").toLowerCase()}.${(i(e.locale.person.lastName, e.source) ?? "name").toLowerCase()}@${i(a.domains, e.source) ?? "example"}.${i(a.tlds, e.source) ?? "com"}`;
|
|
47
|
+
}
|
|
48
|
+
function u(e) {
|
|
49
|
+
return t(0, 1, e.source) === 0 ? n(t(6, 12, e.source), e.source) : `${(i(e.locale.person.firstNameFemale, e.source) ?? i(e.locale.person.firstNameMale, e.source) ?? "user").toLowerCase()}.${(i(e.locale.person.lastName, e.source) ?? "name").toLowerCase()}`;
|
|
50
|
+
}
|
|
51
|
+
function d(e, r = {}) {
|
|
52
|
+
let a = r.length ?? 12;
|
|
53
|
+
if (r.memorable) {
|
|
54
|
+
let r = (i(e.locale.person.firstNameFemale, e.source) ?? i(e.locale.person.firstNameMale, e.source) ?? "user").toLowerCase(), o = (i(e.locale.person.lastName, e.source) ?? "name").toLowerCase(), c = String(t(10, 99, e.source)), l = i(s.split(""), e.source) ?? "!", u = `${r}${o}${c}${l}`;
|
|
55
|
+
if (u.length <= a) return u + n(a - u.length, e.source);
|
|
56
|
+
let d = `${c}${l}`, f = a - d.length, p = d + (f > 0 ? (r + o).slice(0, f) : "");
|
|
57
|
+
return p.length < a ? p + n(a - p.length, e.source) : p.slice(0, a);
|
|
58
|
+
}
|
|
59
|
+
let o = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", c = [
|
|
60
|
+
o,
|
|
61
|
+
"abcdefghijklmnopqrstuvwxyz",
|
|
62
|
+
"0123456789",
|
|
63
|
+
s
|
|
64
|
+
], l = [];
|
|
65
|
+
for (let t of c) l.push(t[Math.floor(e.source.next() * t.length)] ?? o[0]);
|
|
66
|
+
for (; l.length < a;) l.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?"[Math.floor(e.source.next() * 88)] ?? "a");
|
|
67
|
+
for (let t = l.length - 1; t > 0; t--) {
|
|
68
|
+
let n = Math.floor(e.source.next() * (t + 1));
|
|
69
|
+
[l[t], l[n]] = [l[n], l[t]];
|
|
70
|
+
}
|
|
71
|
+
return l.slice(0, a).join("");
|
|
72
|
+
}
|
|
73
|
+
function f(e) {
|
|
74
|
+
let r = i(a.protocols, e.source) ?? "https", o = `${i([
|
|
75
|
+
"www",
|
|
76
|
+
"api",
|
|
77
|
+
"app",
|
|
78
|
+
"mail",
|
|
79
|
+
"static",
|
|
80
|
+
"cdn"
|
|
81
|
+
], e.source) ?? "www"}.${i(a.domains, e.source) ?? "example"}.${i(a.tlds, e.source) ?? "com"}`, s = t(1, 4, e.source), l = [];
|
|
82
|
+
for (let r = 0; r < s; r++) {
|
|
83
|
+
let r = i(c, e.source) ?? "api";
|
|
84
|
+
t(0, 2, e.source) === 0 ? l.push(`${r}-${n(t(2, 5), e.source).toLowerCase()}`) : l.push(r);
|
|
85
|
+
}
|
|
86
|
+
return `${r}://${o}/${l.join("/")}`;
|
|
87
|
+
}
|
|
88
|
+
function p(e) {
|
|
89
|
+
return `${i(a.domains, e.source) ?? "example"}.${i(a.tlds, e.source) ?? "com"}`;
|
|
90
|
+
}
|
|
91
|
+
function m(e, n = 4) {
|
|
92
|
+
if (n === 6) {
|
|
93
|
+
let t = [];
|
|
94
|
+
for (let n = 0; n < 8; n++) t.push(r(4, e.source));
|
|
95
|
+
return t.join(":");
|
|
96
|
+
}
|
|
97
|
+
let i = [];
|
|
98
|
+
for (let n = 0; n < 4; n++) i.push(t(0, 255, e.source));
|
|
99
|
+
return i.join(".");
|
|
100
|
+
}
|
|
101
|
+
function h(e) {
|
|
102
|
+
let t = [];
|
|
103
|
+
for (let n = 0; n < 6; n++) t.push(r(2, e.source));
|
|
104
|
+
return t.join(":");
|
|
105
|
+
}
|
|
106
|
+
function g(e) {
|
|
107
|
+
return i(a.userAgents, e.source) ?? a.userAgents[0];
|
|
108
|
+
}
|
|
109
|
+
function _(e) {
|
|
110
|
+
return i(a.httpMethods, e.source) ?? "GET";
|
|
111
|
+
}
|
|
112
|
+
function v(e) {
|
|
113
|
+
return i(a.statusCodes, e.source) ?? 200;
|
|
114
|
+
}
|
|
115
|
+
function y(e) {
|
|
116
|
+
return i(a.mimeTypes, e.source) ?? "text/plain";
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { p as domainName, l as email, _ as httpMethod, o as internet_exports, m as ip, h as mac, y as mimeType, d as password, v as statusCode, f as url, g as userAgent, u as username };
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=internet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internet.js","names":[],"sources":["../../src/internet/internet.ts"],"sourcesContent":["import { int } from '../_helpers/int';\nimport { alphanumeric, hexString, pick } from '../_helpers/string';\nimport type { IllusionistContext } from '../types';\nimport { INTERNET_DATA } from './data';\n\nconst SPECIAL_CHARS = '!@#$%^&*()_+-=[]{}|;:,.<>?';\n\nconst URL_PATH_WORDS = [\n 'api',\n 'v1',\n 'v2',\n 'users',\n 'posts',\n 'comments',\n 'articles',\n 'products',\n 'orders',\n 'items',\n 'search',\n 'auth',\n 'login',\n 'logout',\n 'profile',\n 'settings',\n 'dashboard',\n 'files',\n 'images',\n 'assets',\n 'static',\n 'public',\n 'private',\n 'admin',\n 'reports',\n];\n\n/** Generates an email address of the form `firstname.lastname@domain.tld`. */\nexport function email(ctx: IllusionistContext): string {\n const first = (\n pick(ctx.locale.person.firstNameFemale, ctx.source) ??\n pick(ctx.locale.person.firstNameMale, ctx.source) ??\n 'user'\n ).toLowerCase();\n const last = (pick(ctx.locale.person.lastName, ctx.source) ?? 'name').toLowerCase();\n const domain = pick(INTERNET_DATA.domains, ctx.source) ?? 'example';\n const tld = pick(INTERNET_DATA.tlds, ctx.source) ?? 'com';\n return `${first}.${last}@${domain}.${tld}`;\n}\n\n/** Generates a username: either a random alphanumeric string or a `firstname.lastname` pattern. */\nexport function username(ctx: IllusionistContext): string {\n if (int(0, 1, ctx.source) === 0) {\n return alphanumeric(int(6, 12, ctx.source), ctx.source);\n }\n const first = (\n pick(ctx.locale.person.firstNameFemale, ctx.source) ??\n pick(ctx.locale.person.firstNameMale, ctx.source) ??\n 'user'\n ).toLowerCase();\n const last = (pick(ctx.locale.person.lastName, ctx.source) ?? 'name').toLowerCase();\n return `${first}.${last}`;\n}\n\n/** Options for {@link password}. */\nexport type PasswordOptions = {\n /** Password length. Defaults to `12`. */\n length?: number;\n /** When `true`, builds a memorable password from name fragments and digits. */\n memorable?: boolean;\n};\n\n/** Generates a password mixing upper/lowercase letters, digits, and special characters. */\nexport function password(ctx: IllusionistContext, opts: PasswordOptions = {}): string {\n const length = opts.length ?? 12;\n\n if (opts.memorable) {\n const first = (\n pick(ctx.locale.person.firstNameFemale, ctx.source) ??\n pick(ctx.locale.person.firstNameMale, ctx.source) ??\n 'user'\n ).toLowerCase();\n const last = (pick(ctx.locale.person.lastName, ctx.source) ?? 'name').toLowerCase();\n const num = String(int(10, 99, ctx.source));\n const special = pick(SPECIAL_CHARS.split(''), ctx.source) ?? '!';\n const base = `${first}${last}${num}${special}`;\n if (base.length <= length) return base + alphanumeric(length - base.length, ctx.source);\n // Truncation would cut the special char/number — put them first, then fill from the name.\n const essential = `${num}${special}`;\n const remaining = length - essential.length;\n const namePart = remaining > 0 ? (first + last).slice(0, remaining) : '';\n const result = essential + namePart;\n\n return result.length < length ? result + alphanumeric(length - result.length, ctx.source) : result.slice(0, length);\n }\n\n const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n const lower = 'abcdefghijklmnopqrstuvwxyz';\n const digits = '0123456789';\n const pools = [upper, lower, digits, SPECIAL_CHARS];\n\n // Guarantee at least one char from each pool, then fill the rest randomly.\n const chars: string[] = [];\n for (const pool of pools) {\n chars.push(pool[Math.floor(ctx.source.next() * pool.length)] ?? upper[0]!);\n }\n const all = upper + lower + digits + SPECIAL_CHARS;\n while (chars.length < length) {\n chars.push(all[Math.floor(ctx.source.next() * all.length)] ?? 'a');\n }\n\n // Shuffle via Fisher-Yates using ctx.source.\n for (let i = chars.length - 1; i > 0; i--) {\n const j = Math.floor(ctx.source.next() * (i + 1));\n [chars[i], chars[j]] = [chars[j]!, chars[i]!];\n }\n\n return chars.slice(0, length).join('');\n}\n\n/** Generates a URL of the form `protocol://sub.domain.tld/path/...`. */\nexport function url(ctx: IllusionistContext): string {\n const protocol = pick(INTERNET_DATA.protocols, ctx.source) ?? 'https';\n const sub = pick(['www', 'api', 'app', 'mail', 'static', 'cdn'], ctx.source) ?? 'www';\n const domain = pick(INTERNET_DATA.domains, ctx.source) ?? 'example';\n const tld = pick(INTERNET_DATA.tlds, ctx.source) ?? 'com';\n const host = `${sub}.${domain}.${tld}`;\n\n const segmentCount = int(1, 4, ctx.source);\n const segments: string[] = [];\n for (let i = 0; i < segmentCount; i++) {\n const word = pick(URL_PATH_WORDS, ctx.source) ?? 'api';\n // Occasionally append a numeric or short alphanumeric suffix to a segment.\n if (int(0, 2, ctx.source) === 0) {\n segments.push(`${word}-${alphanumeric(int(2, 5), ctx.source).toLowerCase()}`);\n } else {\n segments.push(word);\n }\n }\n\n return `${protocol}://${host}/${segments.join('/')}`;\n}\n\n/** Generates a domain name of the form `domain.tld`. */\nexport function domainName(ctx: IllusionistContext): string {\n const domain = pick(INTERNET_DATA.domains, ctx.source) ?? 'example';\n const tld = pick(INTERNET_DATA.tlds, ctx.source) ?? 'com';\n return `${domain}.${tld}`;\n}\n\n/** Generates an IPv4 or IPv6 address. Defaults to IPv4. */\nexport function ip(ctx: IllusionistContext, version: 4 | 6 = 4): string {\n if (version === 6) {\n const groups: string[] = [];\n for (let i = 0; i < 8; i++) {\n groups.push(hexString(4, ctx.source));\n }\n return groups.join(':');\n }\n const octets: number[] = [];\n for (let i = 0; i < 4; i++) {\n octets.push(int(0, 255, ctx.source));\n }\n return octets.join('.');\n}\n\n/** Generates a MAC address of the form `XX:XX:XX:XX:XX:XX`. */\nexport function mac(ctx: IllusionistContext): string {\n const parts: string[] = [];\n for (let i = 0; i < 6; i++) {\n parts.push(hexString(2, ctx.source));\n }\n return parts.join(':');\n}\n\n/** Picks a random user agent string. */\nexport function userAgent(ctx: IllusionistContext): string {\n return pick(INTERNET_DATA.userAgents, ctx.source) ?? INTERNET_DATA.userAgents[0]!;\n}\n\n/** Picks a random HTTP method. */\nexport function httpMethod(ctx: IllusionistContext): string {\n return pick(INTERNET_DATA.httpMethods, ctx.source) ?? 'GET';\n}\n\n/** Picks a random HTTP status code. */\nexport function statusCode(ctx: IllusionistContext): number {\n return pick(INTERNET_DATA.statusCodes, ctx.source) ?? 200;\n}\n\n/** Picks a random MIME type. */\nexport function mimeType(ctx: IllusionistContext): string {\n return pick(INTERNET_DATA.mimeTypes, ctx.source) ?? 'text/plain';\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.cjs","names":[],"sources":["../../src/locales/de.ts"],"sourcesContent":["import { LOCATION_DATA_DE } from '../location/data/de';\nimport { PERSON_DATA_DE } from '../person/data/de';\nimport type { IllusionistLocale } from '../types';\n\n/** German locale data for Illusionist. */\nexport const de = {\n code: 'de',\n location: LOCATION_DATA_DE,\n person: PERSON_DATA_DE,\n} satisfies IllusionistLocale;\n"],"mappings":"iJAKA,IAAa,EAAK,CAChB,KAAM,KACN,SAAU,EAAA,iBACV,OAAQ,EAAA,cACV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** German locale data for Illusionist. */
|
|
2
|
+
export declare const de: {
|
|
3
|
+
code: string;
|
|
4
|
+
location: {
|
|
5
|
+
readonly cities: readonly ["Berlin", "Hamburg", "München", "Köln", "Frankfurt am Main", "Stuttgart", "Düsseldorf", "Leipzig", "Dortmund", "Essen", "Bremen", "Dresden", "Hannover", "Nürnberg", "Duisburg", "Bochum", "Wuppertal", "Bielefeld", "Bonn", "Münster"];
|
|
6
|
+
readonly countries: readonly ["Deutschland", "Österreich", "Schweiz", "Frankreich", "Italien", "Spanien", "Niederlande", "Belgien", "Polen", "Tschechien", "Dänemark", "Schweden", "Norwegen", "Finnland", "Portugal"];
|
|
7
|
+
readonly states: readonly ["Baden-Württemberg", "Bayern", "Berlin", "Brandenburg", "Bremen", "Hamburg", "Hessen", "Mecklenburg-Vorpommern", "Niedersachsen", "Nordrhein-Westfalen", "Rheinland-Pfalz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig-Holstein", "Thüringen"];
|
|
8
|
+
readonly streets: readonly ["Hauptstraße", "Schulstraße", "Bahnhofstraße", "Gartenstraße", "Bergstraße", "Dorfstraße", "Lindenstraße", "Goethestraße", "Schillerstraße", "Mozartstraße", "Bahnhofplatz", "Marktplatz", "Kirchplatz", "Schlossplatz", "Waldrand"];
|
|
9
|
+
readonly zipPattern: "#####";
|
|
10
|
+
};
|
|
11
|
+
person: {
|
|
12
|
+
firstNameFemale: string[];
|
|
13
|
+
firstNameMale: string[];
|
|
14
|
+
gender: string[];
|
|
15
|
+
jobAreas: string[];
|
|
16
|
+
jobTypes: string[];
|
|
17
|
+
lastName: string[];
|
|
18
|
+
prefix: string[];
|
|
19
|
+
suffix: never[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=de.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../src/locales/de.ts"],"names":[],"mappings":"AAIA,0CAA0C;AAC1C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;CAIc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LOCATION_DATA_DE as e } from "../location/data/de.js";
|
|
2
|
+
import { PERSON_DATA_DE as t } from "../person/data/de.js";
|
|
3
|
+
//#region src/locales/de.ts
|
|
4
|
+
var n = {
|
|
5
|
+
code: "de",
|
|
6
|
+
location: e,
|
|
7
|
+
person: t
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as de };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=de.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.js","names":[],"sources":["../../src/locales/de.ts"],"sourcesContent":["import { LOCATION_DATA_DE } from '../location/data/de';\nimport { PERSON_DATA_DE } from '../person/data/de';\nimport type { IllusionistLocale } from '../types';\n\n/** German locale data for Illusionist. */\nexport const de = {\n code: 'de',\n location: LOCATION_DATA_DE,\n person: PERSON_DATA_DE,\n} satisfies IllusionistLocale;\n"],"mappings":";;;AAKA,IAAa,IAAK;CAChB,MAAM;CACN,UAAU;CACV,QAAQ;AACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.cjs","names":[],"sources":["../../src/locales/en.ts"],"sourcesContent":["import { LOCATION_DATA_EN } from '../location/data/en';\nimport { PERSON_DATA_EN } from '../person/data/en';\nimport type { IllusionistLocale } from '../types';\n\n/** English locale data for Illusionist. */\nexport const en = {\n code: 'en',\n location: LOCATION_DATA_EN,\n person: PERSON_DATA_EN,\n} satisfies IllusionistLocale;\n"],"mappings":"iJAKA,IAAa,EAAK,CAChB,KAAM,KACN,SAAU,EAAA,iBACV,OAAQ,EAAA,cACV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** English locale data for Illusionist. */
|
|
2
|
+
export declare const en: {
|
|
3
|
+
code: string;
|
|
4
|
+
location: {
|
|
5
|
+
readonly cities: readonly ["New York", "Los Angeles", "Chicago", "Houston", "Phoenix", "Philadelphia", "San Antonio", "San Diego", "Dallas", "San Jose", "Austin", "Jacksonville", "Fort Worth", "Columbus", "Charlotte", "San Francisco", "Indianapolis", "Seattle", "Denver", "Boston"];
|
|
6
|
+
readonly countries: readonly ["United States", "United Kingdom", "Germany", "France", "Italy", "Spain", "Netherlands", "Belgium", "Switzerland", "Austria", "Canada", "Australia", "Japan", "Brazil", "India"];
|
|
7
|
+
readonly states: readonly ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"];
|
|
8
|
+
readonly streets: readonly ["Main St", "Oak Ave", "Maple Dr", "Cedar Ln", "Pine Rd", "Elm St", "Washington Blvd", "Park Ave", "Lake Dr", "Hill Rd", "River Rd", "Spring St", "Forest Dr", "Sunset Blvd", "Highland Ave"];
|
|
9
|
+
readonly zipPattern: "#####";
|
|
10
|
+
};
|
|
11
|
+
person: {
|
|
12
|
+
firstNameFemale: string[];
|
|
13
|
+
firstNameMale: string[];
|
|
14
|
+
gender: string[];
|
|
15
|
+
jobAreas: string[];
|
|
16
|
+
jobTypes: string[];
|
|
17
|
+
lastName: string[];
|
|
18
|
+
prefix: string[];
|
|
19
|
+
suffix: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAIA,2CAA2C;AAC3C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;CAIc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LOCATION_DATA_EN as e } from "../location/data/en.js";
|
|
2
|
+
import { PERSON_DATA_EN as t } from "../person/data/en.js";
|
|
3
|
+
//#region src/locales/en.ts
|
|
4
|
+
var n = {
|
|
5
|
+
code: "en",
|
|
6
|
+
location: e,
|
|
7
|
+
person: t
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as en };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.js","names":[],"sources":["../../src/locales/en.ts"],"sourcesContent":["import { LOCATION_DATA_EN } from '../location/data/en';\nimport { PERSON_DATA_EN } from '../person/data/en';\nimport type { IllusionistLocale } from '../types';\n\n/** English locale data for Illusionist. */\nexport const en = {\n code: 'en',\n location: LOCATION_DATA_EN,\n person: PERSON_DATA_EN,\n} satisfies IllusionistLocale;\n"],"mappings":";;;AAKA,IAAa,IAAK;CAChB,MAAM;CACN,UAAU;CACV,QAAQ;AACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./de.cjs"),t=require("./en.cjs");exports.de=e.de,exports.en=t.en;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={cities:[`Berlin`,`Hamburg`,`München`,`Köln`,`Frankfurt am Main`,`Stuttgart`,`Düsseldorf`,`Leipzig`,`Dortmund`,`Essen`,`Bremen`,`Dresden`,`Hannover`,`Nürnberg`,`Duisburg`,`Bochum`,`Wuppertal`,`Bielefeld`,`Bonn`,`Münster`],countries:[`Deutschland`,`Österreich`,`Schweiz`,`Frankreich`,`Italien`,`Spanien`,`Niederlande`,`Belgien`,`Polen`,`Tschechien`,`Dänemark`,`Schweden`,`Norwegen`,`Finnland`,`Portugal`],states:[`Baden-Württemberg`,`Bayern`,`Berlin`,`Brandenburg`,`Bremen`,`Hamburg`,`Hessen`,`Mecklenburg-Vorpommern`,`Niedersachsen`,`Nordrhein-Westfalen`,`Rheinland-Pfalz`,`Saarland`,`Sachsen`,`Sachsen-Anhalt`,`Schleswig-Holstein`,`Thüringen`],streets:[`Hauptstraße`,`Schulstraße`,`Bahnhofstraße`,`Gartenstraße`,`Bergstraße`,`Dorfstraße`,`Lindenstraße`,`Goethestraße`,`Schillerstraße`,`Mozartstraße`,`Bahnhofplatz`,`Marktplatz`,`Kirchplatz`,`Schlossplatz`,`Waldrand`],zipPattern:`#####`};exports.LOCATION_DATA_DE=e;
|
|
2
|
+
//# sourceMappingURL=de.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.cjs","names":[],"sources":["../../../src/location/data/de.ts"],"sourcesContent":["/** German-language location dataset for the `location` category. */\nexport const LOCATION_DATA_DE = {\n cities: [\n 'Berlin',\n 'Hamburg',\n 'München',\n 'Köln',\n 'Frankfurt am Main',\n 'Stuttgart',\n 'Düsseldorf',\n 'Leipzig',\n 'Dortmund',\n 'Essen',\n 'Bremen',\n 'Dresden',\n 'Hannover',\n 'Nürnberg',\n 'Duisburg',\n 'Bochum',\n 'Wuppertal',\n 'Bielefeld',\n 'Bonn',\n 'Münster',\n ],\n countries: [\n 'Deutschland',\n 'Österreich',\n 'Schweiz',\n 'Frankreich',\n 'Italien',\n 'Spanien',\n 'Niederlande',\n 'Belgien',\n 'Polen',\n 'Tschechien',\n 'Dänemark',\n 'Schweden',\n 'Norwegen',\n 'Finnland',\n 'Portugal',\n ],\n states: [\n 'Baden-Württemberg',\n 'Bayern',\n 'Berlin',\n 'Brandenburg',\n 'Bremen',\n 'Hamburg',\n 'Hessen',\n 'Mecklenburg-Vorpommern',\n 'Niedersachsen',\n 'Nordrhein-Westfalen',\n 'Rheinland-Pfalz',\n 'Saarland',\n 'Sachsen',\n 'Sachsen-Anhalt',\n 'Schleswig-Holstein',\n 'Thüringen',\n ],\n streets: [\n 'Hauptstraße',\n 'Schulstraße',\n 'Bahnhofstraße',\n 'Gartenstraße',\n 'Bergstraße',\n 'Dorfstraße',\n 'Lindenstraße',\n 'Goethestraße',\n 'Schillerstraße',\n 'Mozartstraße',\n 'Bahnhofplatz',\n 'Marktplatz',\n 'Kirchplatz',\n 'Schlossplatz',\n 'Waldrand',\n ],\n zipPattern: '#####',\n} as const;\n"],"mappings":"AACA,IAAa,EAAmB,CAC9B,OAAQ,CACN,SACA,UACA,UACA,OACA,oBACA,YACA,aACA,UACA,WACA,QACA,SACA,UACA,WACA,WACA,WACA,SACA,YACA,YACA,OACA,SACF,EACA,UAAW,CACT,cACA,aACA,UACA,aACA,UACA,UACA,cACA,UACA,QACA,aACA,WACA,WACA,WACA,WACA,UACF,EACA,OAAQ,CACN,oBACA,SACA,SACA,cACA,SACA,UACA,SACA,yBACA,gBACA,sBACA,kBACA,WACA,UACA,iBACA,qBACA,WACF,EACA,QAAS,CACP,cACA,cACA,gBACA,eACA,aACA,aACA,eACA,eACA,iBACA,eACA,eACA,aACA,aACA,eACA,UACF,EACA,WAAY,OACd"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** German-language location dataset for the `location` category. */
|
|
2
|
+
export declare const LOCATION_DATA_DE: {
|
|
3
|
+
readonly cities: readonly ["Berlin", "Hamburg", "München", "Köln", "Frankfurt am Main", "Stuttgart", "Düsseldorf", "Leipzig", "Dortmund", "Essen", "Bremen", "Dresden", "Hannover", "Nürnberg", "Duisburg", "Bochum", "Wuppertal", "Bielefeld", "Bonn", "Münster"];
|
|
4
|
+
readonly countries: readonly ["Deutschland", "Österreich", "Schweiz", "Frankreich", "Italien", "Spanien", "Niederlande", "Belgien", "Polen", "Tschechien", "Dänemark", "Schweden", "Norwegen", "Finnland", "Portugal"];
|
|
5
|
+
readonly states: readonly ["Baden-Württemberg", "Bayern", "Berlin", "Brandenburg", "Bremen", "Hamburg", "Hessen", "Mecklenburg-Vorpommern", "Niedersachsen", "Nordrhein-Westfalen", "Rheinland-Pfalz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig-Holstein", "Thüringen"];
|
|
6
|
+
readonly streets: readonly ["Hauptstraße", "Schulstraße", "Bahnhofstraße", "Gartenstraße", "Bergstraße", "Dorfstraße", "Lindenstraße", "Goethestraße", "Schillerstraße", "Mozartstraße", "Bahnhofplatz", "Marktplatz", "Kirchplatz", "Schlossplatz", "Waldrand"];
|
|
7
|
+
readonly zipPattern: "#####";
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=de.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../src/location/data/de.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,eAAO,MAAM,gBAAgB;;;;;;CA4EnB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//#region src/location/data/de.ts
|
|
2
|
+
var e = {
|
|
3
|
+
cities: [
|
|
4
|
+
"Berlin",
|
|
5
|
+
"Hamburg",
|
|
6
|
+
"München",
|
|
7
|
+
"Köln",
|
|
8
|
+
"Frankfurt am Main",
|
|
9
|
+
"Stuttgart",
|
|
10
|
+
"Düsseldorf",
|
|
11
|
+
"Leipzig",
|
|
12
|
+
"Dortmund",
|
|
13
|
+
"Essen",
|
|
14
|
+
"Bremen",
|
|
15
|
+
"Dresden",
|
|
16
|
+
"Hannover",
|
|
17
|
+
"Nürnberg",
|
|
18
|
+
"Duisburg",
|
|
19
|
+
"Bochum",
|
|
20
|
+
"Wuppertal",
|
|
21
|
+
"Bielefeld",
|
|
22
|
+
"Bonn",
|
|
23
|
+
"Münster"
|
|
24
|
+
],
|
|
25
|
+
countries: [
|
|
26
|
+
"Deutschland",
|
|
27
|
+
"Österreich",
|
|
28
|
+
"Schweiz",
|
|
29
|
+
"Frankreich",
|
|
30
|
+
"Italien",
|
|
31
|
+
"Spanien",
|
|
32
|
+
"Niederlande",
|
|
33
|
+
"Belgien",
|
|
34
|
+
"Polen",
|
|
35
|
+
"Tschechien",
|
|
36
|
+
"Dänemark",
|
|
37
|
+
"Schweden",
|
|
38
|
+
"Norwegen",
|
|
39
|
+
"Finnland",
|
|
40
|
+
"Portugal"
|
|
41
|
+
],
|
|
42
|
+
states: [
|
|
43
|
+
"Baden-Württemberg",
|
|
44
|
+
"Bayern",
|
|
45
|
+
"Berlin",
|
|
46
|
+
"Brandenburg",
|
|
47
|
+
"Bremen",
|
|
48
|
+
"Hamburg",
|
|
49
|
+
"Hessen",
|
|
50
|
+
"Mecklenburg-Vorpommern",
|
|
51
|
+
"Niedersachsen",
|
|
52
|
+
"Nordrhein-Westfalen",
|
|
53
|
+
"Rheinland-Pfalz",
|
|
54
|
+
"Saarland",
|
|
55
|
+
"Sachsen",
|
|
56
|
+
"Sachsen-Anhalt",
|
|
57
|
+
"Schleswig-Holstein",
|
|
58
|
+
"Thüringen"
|
|
59
|
+
],
|
|
60
|
+
streets: [
|
|
61
|
+
"Hauptstraße",
|
|
62
|
+
"Schulstraße",
|
|
63
|
+
"Bahnhofstraße",
|
|
64
|
+
"Gartenstraße",
|
|
65
|
+
"Bergstraße",
|
|
66
|
+
"Dorfstraße",
|
|
67
|
+
"Lindenstraße",
|
|
68
|
+
"Goethestraße",
|
|
69
|
+
"Schillerstraße",
|
|
70
|
+
"Mozartstraße",
|
|
71
|
+
"Bahnhofplatz",
|
|
72
|
+
"Marktplatz",
|
|
73
|
+
"Kirchplatz",
|
|
74
|
+
"Schlossplatz",
|
|
75
|
+
"Waldrand"
|
|
76
|
+
],
|
|
77
|
+
zipPattern: "#####"
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { e as LOCATION_DATA_DE };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=de.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.js","names":[],"sources":["../../../src/location/data/de.ts"],"sourcesContent":["/** German-language location dataset for the `location` category. */\nexport const LOCATION_DATA_DE = {\n cities: [\n 'Berlin',\n 'Hamburg',\n 'München',\n 'Köln',\n 'Frankfurt am Main',\n 'Stuttgart',\n 'Düsseldorf',\n 'Leipzig',\n 'Dortmund',\n 'Essen',\n 'Bremen',\n 'Dresden',\n 'Hannover',\n 'Nürnberg',\n 'Duisburg',\n 'Bochum',\n 'Wuppertal',\n 'Bielefeld',\n 'Bonn',\n 'Münster',\n ],\n countries: [\n 'Deutschland',\n 'Österreich',\n 'Schweiz',\n 'Frankreich',\n 'Italien',\n 'Spanien',\n 'Niederlande',\n 'Belgien',\n 'Polen',\n 'Tschechien',\n 'Dänemark',\n 'Schweden',\n 'Norwegen',\n 'Finnland',\n 'Portugal',\n ],\n states: [\n 'Baden-Württemberg',\n 'Bayern',\n 'Berlin',\n 'Brandenburg',\n 'Bremen',\n 'Hamburg',\n 'Hessen',\n 'Mecklenburg-Vorpommern',\n 'Niedersachsen',\n 'Nordrhein-Westfalen',\n 'Rheinland-Pfalz',\n 'Saarland',\n 'Sachsen',\n 'Sachsen-Anhalt',\n 'Schleswig-Holstein',\n 'Thüringen',\n ],\n streets: [\n 'Hauptstraße',\n 'Schulstraße',\n 'Bahnhofstraße',\n 'Gartenstraße',\n 'Bergstraße',\n 'Dorfstraße',\n 'Lindenstraße',\n 'Goethestraße',\n 'Schillerstraße',\n 'Mozartstraße',\n 'Bahnhofplatz',\n 'Marktplatz',\n 'Kirchplatz',\n 'Schlossplatz',\n 'Waldrand',\n ],\n zipPattern: '#####',\n} as const;\n"],"mappings":";AACA,IAAa,IAAmB;CAC9B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,YAAY;AACd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={cities:[`New York`,`Los Angeles`,`Chicago`,`Houston`,`Phoenix`,`Philadelphia`,`San Antonio`,`San Diego`,`Dallas`,`San Jose`,`Austin`,`Jacksonville`,`Fort Worth`,`Columbus`,`Charlotte`,`San Francisco`,`Indianapolis`,`Seattle`,`Denver`,`Boston`],countries:[`United States`,`United Kingdom`,`Germany`,`France`,`Italy`,`Spain`,`Netherlands`,`Belgium`,`Switzerland`,`Austria`,`Canada`,`Australia`,`Japan`,`Brazil`,`India`],states:`Alabama.Alaska.Arizona.Arkansas.California.Colorado.Connecticut.Delaware.Florida.Georgia.Hawaii.Idaho.Illinois.Indiana.Iowa.Kansas.Kentucky.Louisiana.Maine.Maryland.Massachusetts.Michigan.Minnesota.Mississippi.Missouri.Montana.Nebraska.Nevada.New Hampshire.New Jersey.New Mexico.New York.North Carolina.North Dakota.Ohio.Oklahoma.Oregon.Pennsylvania.Rhode Island.South Carolina.South Dakota.Tennessee.Texas.Utah.Vermont.Virginia.Washington.West Virginia.Wisconsin.Wyoming`.split(`.`),streets:[`Main St`,`Oak Ave`,`Maple Dr`,`Cedar Ln`,`Pine Rd`,`Elm St`,`Washington Blvd`,`Park Ave`,`Lake Dr`,`Hill Rd`,`River Rd`,`Spring St`,`Forest Dr`,`Sunset Blvd`,`Highland Ave`],zipPattern:`#####`};exports.LOCATION_DATA_EN=e;
|
|
2
|
+
//# sourceMappingURL=en.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.cjs","names":[],"sources":["../../../src/location/data/en.ts"],"sourcesContent":["/** English-language location dataset for the `location` category. */\nexport const LOCATION_DATA_EN = {\n cities: [\n 'New York',\n 'Los Angeles',\n 'Chicago',\n 'Houston',\n 'Phoenix',\n 'Philadelphia',\n 'San Antonio',\n 'San Diego',\n 'Dallas',\n 'San Jose',\n 'Austin',\n 'Jacksonville',\n 'Fort Worth',\n 'Columbus',\n 'Charlotte',\n 'San Francisco',\n 'Indianapolis',\n 'Seattle',\n 'Denver',\n 'Boston',\n ],\n countries: [\n 'United States',\n 'United Kingdom',\n 'Germany',\n 'France',\n 'Italy',\n 'Spain',\n 'Netherlands',\n 'Belgium',\n 'Switzerland',\n 'Austria',\n 'Canada',\n 'Australia',\n 'Japan',\n 'Brazil',\n 'India',\n ],\n states: [\n 'Alabama',\n 'Alaska',\n 'Arizona',\n 'Arkansas',\n 'California',\n 'Colorado',\n 'Connecticut',\n 'Delaware',\n 'Florida',\n 'Georgia',\n 'Hawaii',\n 'Idaho',\n 'Illinois',\n 'Indiana',\n 'Iowa',\n 'Kansas',\n 'Kentucky',\n 'Louisiana',\n 'Maine',\n 'Maryland',\n 'Massachusetts',\n 'Michigan',\n 'Minnesota',\n 'Mississippi',\n 'Missouri',\n 'Montana',\n 'Nebraska',\n 'Nevada',\n 'New Hampshire',\n 'New Jersey',\n 'New Mexico',\n 'New York',\n 'North Carolina',\n 'North Dakota',\n 'Ohio',\n 'Oklahoma',\n 'Oregon',\n 'Pennsylvania',\n 'Rhode Island',\n 'South Carolina',\n 'South Dakota',\n 'Tennessee',\n 'Texas',\n 'Utah',\n 'Vermont',\n 'Virginia',\n 'Washington',\n 'West Virginia',\n 'Wisconsin',\n 'Wyoming',\n ],\n streets: [\n 'Main St',\n 'Oak Ave',\n 'Maple Dr',\n 'Cedar Ln',\n 'Pine Rd',\n 'Elm St',\n 'Washington Blvd',\n 'Park Ave',\n 'Lake Dr',\n 'Hill Rd',\n 'River Rd',\n 'Spring St',\n 'Forest Dr',\n 'Sunset Blvd',\n 'Highland Ave',\n ],\n zipPattern: '#####',\n} as const;\n"],"mappings":"AACA,IAAa,EAAmB,CAC9B,OAAQ,CACN,WACA,cACA,UACA,UACA,UACA,eACA,cACA,YACA,SACA,WACA,SACA,eACA,aACA,WACA,YACA,gBACA,eACA,UACA,SACA,QACF,EACA,UAAW,CACT,gBACA,iBACA,UACA,SACA,QACA,QACA,cACA,UACA,cACA,UACA,SACA,YACA,QACA,SACA,OACF,EACA,OAAQ,meAmDR,EACA,QAAS,CACP,UACA,UACA,WACA,WACA,UACA,SACA,kBACA,WACA,UACA,UACA,WACA,YACA,YACA,cACA,cACF,EACA,WAAY,OACd"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** English-language location dataset for the `location` category. */
|
|
2
|
+
export declare const LOCATION_DATA_EN: {
|
|
3
|
+
readonly cities: readonly ["New York", "Los Angeles", "Chicago", "Houston", "Phoenix", "Philadelphia", "San Antonio", "San Diego", "Dallas", "San Jose", "Austin", "Jacksonville", "Fort Worth", "Columbus", "Charlotte", "San Francisco", "Indianapolis", "Seattle", "Denver", "Boston"];
|
|
4
|
+
readonly countries: readonly ["United States", "United Kingdom", "Germany", "France", "Italy", "Spain", "Netherlands", "Belgium", "Switzerland", "Austria", "Canada", "Australia", "Japan", "Brazil", "India"];
|
|
5
|
+
readonly states: readonly ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"];
|
|
6
|
+
readonly streets: readonly ["Main St", "Oak Ave", "Maple Dr", "Cedar Ln", "Pine Rd", "Elm St", "Washington Blvd", "Park Ave", "Lake Dr", "Hill Rd", "River Rd", "Spring St", "Forest Dr", "Sunset Blvd", "Highland Ave"];
|
|
7
|
+
readonly zipPattern: "#####";
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/location/data/en.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,gBAAgB;;;;;;CA8GnB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region src/location/data/en.ts
|
|
2
|
+
var e = {
|
|
3
|
+
cities: [
|
|
4
|
+
"New York",
|
|
5
|
+
"Los Angeles",
|
|
6
|
+
"Chicago",
|
|
7
|
+
"Houston",
|
|
8
|
+
"Phoenix",
|
|
9
|
+
"Philadelphia",
|
|
10
|
+
"San Antonio",
|
|
11
|
+
"San Diego",
|
|
12
|
+
"Dallas",
|
|
13
|
+
"San Jose",
|
|
14
|
+
"Austin",
|
|
15
|
+
"Jacksonville",
|
|
16
|
+
"Fort Worth",
|
|
17
|
+
"Columbus",
|
|
18
|
+
"Charlotte",
|
|
19
|
+
"San Francisco",
|
|
20
|
+
"Indianapolis",
|
|
21
|
+
"Seattle",
|
|
22
|
+
"Denver",
|
|
23
|
+
"Boston"
|
|
24
|
+
],
|
|
25
|
+
countries: [
|
|
26
|
+
"United States",
|
|
27
|
+
"United Kingdom",
|
|
28
|
+
"Germany",
|
|
29
|
+
"France",
|
|
30
|
+
"Italy",
|
|
31
|
+
"Spain",
|
|
32
|
+
"Netherlands",
|
|
33
|
+
"Belgium",
|
|
34
|
+
"Switzerland",
|
|
35
|
+
"Austria",
|
|
36
|
+
"Canada",
|
|
37
|
+
"Australia",
|
|
38
|
+
"Japan",
|
|
39
|
+
"Brazil",
|
|
40
|
+
"India"
|
|
41
|
+
],
|
|
42
|
+
states: /* @__PURE__ */ "Alabama.Alaska.Arizona.Arkansas.California.Colorado.Connecticut.Delaware.Florida.Georgia.Hawaii.Idaho.Illinois.Indiana.Iowa.Kansas.Kentucky.Louisiana.Maine.Maryland.Massachusetts.Michigan.Minnesota.Mississippi.Missouri.Montana.Nebraska.Nevada.New Hampshire.New Jersey.New Mexico.New York.North Carolina.North Dakota.Ohio.Oklahoma.Oregon.Pennsylvania.Rhode Island.South Carolina.South Dakota.Tennessee.Texas.Utah.Vermont.Virginia.Washington.West Virginia.Wisconsin.Wyoming".split("."),
|
|
43
|
+
streets: [
|
|
44
|
+
"Main St",
|
|
45
|
+
"Oak Ave",
|
|
46
|
+
"Maple Dr",
|
|
47
|
+
"Cedar Ln",
|
|
48
|
+
"Pine Rd",
|
|
49
|
+
"Elm St",
|
|
50
|
+
"Washington Blvd",
|
|
51
|
+
"Park Ave",
|
|
52
|
+
"Lake Dr",
|
|
53
|
+
"Hill Rd",
|
|
54
|
+
"River Rd",
|
|
55
|
+
"Spring St",
|
|
56
|
+
"Forest Dr",
|
|
57
|
+
"Sunset Blvd",
|
|
58
|
+
"Highland Ave"
|
|
59
|
+
],
|
|
60
|
+
zipPattern: "#####"
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { e as LOCATION_DATA_EN };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.js","names":[],"sources":["../../../src/location/data/en.ts"],"sourcesContent":["/** English-language location dataset for the `location` category. */\nexport const LOCATION_DATA_EN = {\n cities: [\n 'New York',\n 'Los Angeles',\n 'Chicago',\n 'Houston',\n 'Phoenix',\n 'Philadelphia',\n 'San Antonio',\n 'San Diego',\n 'Dallas',\n 'San Jose',\n 'Austin',\n 'Jacksonville',\n 'Fort Worth',\n 'Columbus',\n 'Charlotte',\n 'San Francisco',\n 'Indianapolis',\n 'Seattle',\n 'Denver',\n 'Boston',\n ],\n countries: [\n 'United States',\n 'United Kingdom',\n 'Germany',\n 'France',\n 'Italy',\n 'Spain',\n 'Netherlands',\n 'Belgium',\n 'Switzerland',\n 'Austria',\n 'Canada',\n 'Australia',\n 'Japan',\n 'Brazil',\n 'India',\n ],\n states: [\n 'Alabama',\n 'Alaska',\n 'Arizona',\n 'Arkansas',\n 'California',\n 'Colorado',\n 'Connecticut',\n 'Delaware',\n 'Florida',\n 'Georgia',\n 'Hawaii',\n 'Idaho',\n 'Illinois',\n 'Indiana',\n 'Iowa',\n 'Kansas',\n 'Kentucky',\n 'Louisiana',\n 'Maine',\n 'Maryland',\n 'Massachusetts',\n 'Michigan',\n 'Minnesota',\n 'Mississippi',\n 'Missouri',\n 'Montana',\n 'Nebraska',\n 'Nevada',\n 'New Hampshire',\n 'New Jersey',\n 'New Mexico',\n 'New York',\n 'North Carolina',\n 'North Dakota',\n 'Ohio',\n 'Oklahoma',\n 'Oregon',\n 'Pennsylvania',\n 'Rhode Island',\n 'South Carolina',\n 'South Dakota',\n 'Tennessee',\n 'Texas',\n 'Utah',\n 'Vermont',\n 'Virginia',\n 'Washington',\n 'West Virginia',\n 'Wisconsin',\n 'Wyoming',\n ],\n streets: [\n 'Main St',\n 'Oak Ave',\n 'Maple Dr',\n 'Cedar Ln',\n 'Pine Rd',\n 'Elm St',\n 'Washington Blvd',\n 'Park Ave',\n 'Lake Dr',\n 'Hill Rd',\n 'River Rd',\n 'Spring St',\n 'Forest Dr',\n 'Sunset Blvd',\n 'Highland Ave',\n ],\n zipPattern: '#####',\n} as const;\n"],"mappings":";AACA,IAAa,IAAmB;CAC9B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ,mfAmDR;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,YAAY;AACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./location.cjs");exports.city=e.city,exports.country=e.country,exports.latitude=e.latitude,exports.longitude=e.longitude,exports.nearbyGPSCoordinate=e.nearbyGPSCoordinate,exports.state=e.state,exports.street=e.street,exports.streetAddress=e.streetAddress,exports.zipCode=e.zipCode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/location/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { city as e, country as t, latitude as n, longitude as r, nearbyGPSCoordinate as i, state as a, street as o, streetAddress as s, zipCode as c } from "./location.js";
|
|
2
|
+
export { e as city, t as country, n as latitude, r as longitude, i as nearbyGPSCoordinate, a as state, o as street, s as streetAddress, c as zipCode };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs"),t=require("../_helpers/float.cjs"),n=require("../_helpers/string.cjs");var r=e.__exportAll({city:()=>a,country:()=>u,latitude:()=>d,longitude:()=>f,nearbyGPSCoordinate:()=>p,state:()=>l,street:()=>o,streetAddress:()=>s,zipCode:()=>c});function i(e){return e.locale.location}function a(e){return n.pick(i(e).cities,e.source)}function o(e){return n.pick(i(e).streets,e.source)}function s(e){return`${Math.floor(t.float(1,1e3,e.source))} ${o(e)}`}function c(e){return i(e).zipPattern.replace(/#/g,()=>String(Math.floor((e.source.next()??0)*10)))}function l(e){return n.pick(i(e).states,e.source)}function u(e){return n.pick(i(e).countries,e.source)}function d(e){return t.float(-90,90,e.source)}function f(e){return t.float(-180,180,e.source)}function p(e,n){let r=n??{lat:d(e),lng:f(e)};return{lat:t.float(r.lat-1,r.lat+1,e.source),lng:t.float(r.lng-1,r.lng+1,e.source)}}exports.city=a,exports.country=u,exports.latitude=d,Object.defineProperty(exports,"location_exports",{enumerable:!0,get:function(){return r}}),exports.longitude=f,exports.nearbyGPSCoordinate=p,exports.state=l,exports.street=o,exports.streetAddress=s,exports.zipCode=c;
|
|
2
|
+
//# sourceMappingURL=location.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.cjs","names":[],"sources":["../../src/location/location.ts"],"sourcesContent":["import { float } from '../_helpers/float';\nimport { pick } from '../_helpers/string';\nimport type { IllusionistContext, LocationLocaleData } from '../types';\n\nfunction data(ctx: IllusionistContext): LocationLocaleData {\n return ctx.locale.location;\n}\n\n/** A geographic coordinate pair. */\nexport type Coordinate = {\n lat: number;\n lng: number;\n};\n\n/** Picks a random city from the locale dataset. */\nexport function city(ctx: IllusionistContext): string {\n return pick(data(ctx).cities, ctx.source)!;\n}\n\n/** Picks a random street from the locale dataset. */\nexport function street(ctx: IllusionistContext): string {\n return pick(data(ctx).streets, ctx.source)!;\n}\n\n/** Builds a street address: a house number (1-999) followed by a street name. */\nexport function streetAddress(ctx: IllusionistContext): string {\n const houseNumber = Math.floor(float(1, 1000, ctx.source));\n return `${houseNumber} ${street(ctx)}`;\n}\n\n/** Generates a ZIP/postal code matching the locale's pattern (`#` = digit, other chars preserved). */\nexport function zipCode(ctx: IllusionistContext): string {\n const pattern = data(ctx).zipPattern;\n\n return pattern.replace(/#/g, () => String(Math.floor((ctx.source.next() ?? 0) * 10)));\n}\n\n/** Picks a random state/region from the locale dataset. */\nexport function state(ctx: IllusionistContext): string {\n return pick(data(ctx).states, ctx.source)!;\n}\n\n/** Picks a random country from the locale dataset. */\nexport function country(ctx: IllusionistContext): string {\n return pick(data(ctx).countries, ctx.source)!;\n}\n\n/** Generates a random latitude in the range [-90, 90]. */\nexport function latitude(ctx: IllusionistContext): number {\n return float(-90, 90, ctx.source);\n}\n\n/** Generates a random longitude in the range [-180, 180]. */\nexport function longitude(ctx: IllusionistContext): number {\n return float(-180, 180, ctx.source);\n}\n\n/**\n * Returns a coordinate within ~1 degree of the reference point.\n * When no reference is provided, a random coordinate is used.\n */\nexport function nearbyGPSCoordinate(ctx: IllusionistContext, ref?: Coordinate): Coordinate {\n const base = ref ?? { lat: latitude(ctx), lng: longitude(ctx) };\n return {\n lat: float(base.lat - 1, base.lat + 1, ctx.source),\n lng: float(base.lng - 1, base.lng + 1, ctx.source),\n };\n}\n"],"mappings":"gSAIA,SAAS,EAAK,EAA6C,CACzD,OAAO,EAAI,OAAO,QACpB,CASA,SAAgB,EAAK,EAAiC,CACpD,OAAO,EAAA,KAAK,EAAK,CAAG,CAAC,CAAC,OAAQ,EAAI,MAAM,CAC1C,CAGA,SAAgB,EAAO,EAAiC,CACtD,OAAO,EAAA,KAAK,EAAK,CAAG,CAAC,CAAC,QAAS,EAAI,MAAM,CAC3C,CAGA,SAAgB,EAAc,EAAiC,CAE7D,MAAO,GADa,KAAK,MAAM,EAAA,MAAM,EAAG,IAAM,EAAI,MAAM,CAC9C,EAAY,GAAG,EAAO,CAAG,GACrC,CAGA,SAAgB,EAAQ,EAAiC,CAGvD,OAFgB,EAAK,CAAG,CAAC,CAAC,WAEX,QAAQ,SAAY,OAAO,KAAK,OAAO,EAAI,OAAO,KAAK,GAAK,GAAK,EAAE,CAAC,CAAC,CACtF,CAGA,SAAgB,EAAM,EAAiC,CACrD,OAAO,EAAA,KAAK,EAAK,CAAG,CAAC,CAAC,OAAQ,EAAI,MAAM,CAC1C,CAGA,SAAgB,EAAQ,EAAiC,CACvD,OAAO,EAAA,KAAK,EAAK,CAAG,CAAC,CAAC,UAAW,EAAI,MAAM,CAC7C,CAGA,SAAgB,EAAS,EAAiC,CACxD,OAAO,EAAA,MAAM,IAAK,GAAI,EAAI,MAAM,CAClC,CAGA,SAAgB,EAAU,EAAiC,CACzD,OAAO,EAAA,MAAM,KAAM,IAAK,EAAI,MAAM,CACpC,CAMA,SAAgB,EAAoB,EAAyB,EAA8B,CACzF,IAAM,EAAO,GAAO,CAAE,IAAK,EAAS,CAAG,EAAG,IAAK,EAAU,CAAG,CAAE,EAC9D,MAAO,CACL,IAAK,EAAA,MAAM,EAAK,IAAM,EAAG,EAAK,IAAM,EAAG,EAAI,MAAM,EACjD,IAAK,EAAA,MAAM,EAAK,IAAM,EAAG,EAAK,IAAM,EAAG,EAAI,MAAM,CACnD,CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IllusionistContext } from '../types';
|
|
2
|
+
/** A geographic coordinate pair. */
|
|
3
|
+
export type Coordinate = {
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
};
|
|
7
|
+
/** Picks a random city from the locale dataset. */
|
|
8
|
+
export declare function city(ctx: IllusionistContext): string;
|
|
9
|
+
/** Picks a random street from the locale dataset. */
|
|
10
|
+
export declare function street(ctx: IllusionistContext): string;
|
|
11
|
+
/** Builds a street address: a house number (1-999) followed by a street name. */
|
|
12
|
+
export declare function streetAddress(ctx: IllusionistContext): string;
|
|
13
|
+
/** Generates a ZIP/postal code matching the locale's pattern (`#` = digit, other chars preserved). */
|
|
14
|
+
export declare function zipCode(ctx: IllusionistContext): string;
|
|
15
|
+
/** Picks a random state/region from the locale dataset. */
|
|
16
|
+
export declare function state(ctx: IllusionistContext): string;
|
|
17
|
+
/** Picks a random country from the locale dataset. */
|
|
18
|
+
export declare function country(ctx: IllusionistContext): string;
|
|
19
|
+
/** Generates a random latitude in the range [-90, 90]. */
|
|
20
|
+
export declare function latitude(ctx: IllusionistContext): number;
|
|
21
|
+
/** Generates a random longitude in the range [-180, 180]. */
|
|
22
|
+
export declare function longitude(ctx: IllusionistContext): number;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a coordinate within ~1 degree of the reference point.
|
|
25
|
+
* When no reference is provided, a random coordinate is used.
|
|
26
|
+
*/
|
|
27
|
+
export declare function nearbyGPSCoordinate(ctx: IllusionistContext, ref?: Coordinate): Coordinate;
|
|
28
|
+
//# sourceMappingURL=location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/location/location.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,UAAU,CAAC;AAMvE,oCAAoC;AACpC,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,mDAAmD;AACnD,wBAAgB,IAAI,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAEpD;AAED,qDAAqD;AACrD,wBAAgB,MAAM,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAEtD;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAG7D;AAED,sGAAsG;AACtG,wBAAgB,OAAO,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAIvD;AAED,2DAA2D;AAC3D,wBAAgB,KAAK,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAErD;AAED,sDAAsD;AACtD,wBAAgB,OAAO,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAEvD;AAED,0DAA0D;AAC1D,wBAAgB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAExD;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,UAAU,CAMzF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { float as t } from "../_helpers/float.js";
|
|
3
|
+
import { pick as n } from "../_helpers/string.js";
|
|
4
|
+
//#region src/location/location.ts
|
|
5
|
+
var r = /* @__PURE__ */ e({
|
|
6
|
+
city: () => a,
|
|
7
|
+
country: () => u,
|
|
8
|
+
latitude: () => d,
|
|
9
|
+
longitude: () => f,
|
|
10
|
+
nearbyGPSCoordinate: () => p,
|
|
11
|
+
state: () => l,
|
|
12
|
+
street: () => o,
|
|
13
|
+
streetAddress: () => s,
|
|
14
|
+
zipCode: () => c
|
|
15
|
+
});
|
|
16
|
+
function i(e) {
|
|
17
|
+
return e.locale.location;
|
|
18
|
+
}
|
|
19
|
+
function a(e) {
|
|
20
|
+
return n(i(e).cities, e.source);
|
|
21
|
+
}
|
|
22
|
+
function o(e) {
|
|
23
|
+
return n(i(e).streets, e.source);
|
|
24
|
+
}
|
|
25
|
+
function s(e) {
|
|
26
|
+
return `${Math.floor(t(1, 1e3, e.source))} ${o(e)}`;
|
|
27
|
+
}
|
|
28
|
+
function c(e) {
|
|
29
|
+
return i(e).zipPattern.replace(/#/g, () => String(Math.floor((e.source.next() ?? 0) * 10)));
|
|
30
|
+
}
|
|
31
|
+
function l(e) {
|
|
32
|
+
return n(i(e).states, e.source);
|
|
33
|
+
}
|
|
34
|
+
function u(e) {
|
|
35
|
+
return n(i(e).countries, e.source);
|
|
36
|
+
}
|
|
37
|
+
function d(e) {
|
|
38
|
+
return t(-90, 90, e.source);
|
|
39
|
+
}
|
|
40
|
+
function f(e) {
|
|
41
|
+
return t(-180, 180, e.source);
|
|
42
|
+
}
|
|
43
|
+
function p(e, n) {
|
|
44
|
+
let r = n ?? {
|
|
45
|
+
lat: d(e),
|
|
46
|
+
lng: f(e)
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
lat: t(r.lat - 1, r.lat + 1, e.source),
|
|
50
|
+
lng: t(r.lng - 1, r.lng + 1, e.source)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { a as city, u as country, d as latitude, r as location_exports, f as longitude, p as nearbyGPSCoordinate, l as state, o as street, s as streetAddress, c as zipCode };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=location.js.map
|