@venn-lang/data 0.1.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/LICENSE +21 -0
- package/README.md +143 -0
- package/dist/index.d.ts +152 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1941 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
- package/src/actions/faker-actions.ts +22 -0
- package/src/actions/index.ts +7 -0
- package/src/actions/parse-actions.ts +31 -0
- package/src/actions/random-actions.ts +51 -0
- package/src/csv/csv.types.ts +2 -0
- package/src/csv/index.ts +2 -0
- package/src/csv/parse-csv.ts +30 -0
- package/src/faker/address.ts +70 -0
- package/src/faker/all-specs.ts +25 -0
- package/src/faker/brazil-documents.ts +46 -0
- package/src/faker/brazil.ts +75 -0
- package/src/faker/check-digits.ts +56 -0
- package/src/faker/commerce.ts +59 -0
- package/src/faker/company.ts +41 -0
- package/src/faker/data/business.ts +80 -0
- package/src/faker/data/commerce.ts +73 -0
- package/src/faker/data/index.ts +36 -0
- package/src/faker/data/names.ts +93 -0
- package/src/faker/data/places.ts +109 -0
- package/src/faker/data/web.ts +45 -0
- package/src/faker/data/words.ts +104 -0
- package/src/faker/datetime.ts +102 -0
- package/src/faker/faker.types.ts +24 -0
- package/src/faker/finance.ts +86 -0
- package/src/faker/ids.ts +80 -0
- package/src/faker/index.ts +8 -0
- package/src/faker/internet.ts +100 -0
- package/src/faker/person.ts +88 -0
- package/src/faker/primitives.ts +77 -0
- package/src/faker/text.ts +56 -0
- package/src/index.ts +8 -0
- package/src/plugin.ts +17 -0
- package/src/rng/index.ts +4 -0
- package/src/rng/mulberry32.ts +18 -0
- package/src/rng/rng.types.ts +2 -0
- package/src/rng/shared-rng.ts +15 -0
- package/src/rng/shuffle.ts +17 -0
- package/src/types.ts +14 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { pad } from "./primitives.js";
|
|
2
|
+
|
|
3
|
+
// Check digits for the numbers real forms validate locally. A card, barcode or
|
|
4
|
+
// IBAN with the wrong digit is rejected before any network call, so a generator
|
|
5
|
+
// that skips these produces values no checkout would ever accept.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Luhn check digit for a card number.
|
|
9
|
+
*
|
|
10
|
+
* @param base The digits preceding the check digit.
|
|
11
|
+
* @returns One digit. Appending it makes `base` pass the Luhn test.
|
|
12
|
+
*/
|
|
13
|
+
export function luhnDigit(base: string): string {
|
|
14
|
+
let sum = 0;
|
|
15
|
+
let double = true;
|
|
16
|
+
for (let index = base.length - 1; index >= 0; index -= 1) {
|
|
17
|
+
const scaled = Number(base[index]) * (double ? 2 : 1);
|
|
18
|
+
sum += scaled > 9 ? scaled - 9 : scaled;
|
|
19
|
+
double = !double;
|
|
20
|
+
}
|
|
21
|
+
return String((10 - (sum % 10)) % 10);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The EAN-13 check digit for the leading 12 digits of a barcode.
|
|
26
|
+
*
|
|
27
|
+
* @param base Exactly 12 digits.
|
|
28
|
+
* @returns The thirteenth digit.
|
|
29
|
+
*/
|
|
30
|
+
export function eanDigit(base: string): string {
|
|
31
|
+
let sum = 0;
|
|
32
|
+
for (let index = 0; index < base.length; index += 1) {
|
|
33
|
+
sum += Number(base[index]) * (index % 2 === 0 ? 1 : 3);
|
|
34
|
+
}
|
|
35
|
+
return String((10 - (sum % 10)) % 10);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The two IBAN check digits: mod-97 over the rearranged, letter-expanded account.
|
|
40
|
+
*
|
|
41
|
+
* @param country The two-letter country code, upper case.
|
|
42
|
+
* @param account The account part, without check digits.
|
|
43
|
+
* @returns Two digits, zero-padded, to be inserted after the country code.
|
|
44
|
+
*/
|
|
45
|
+
export function ibanCheck(country: string, account: string): string {
|
|
46
|
+
const rearranged = `${account}${country}00`;
|
|
47
|
+
const expanded = rearranged.replace(/[A-Z]/g, (letter) => String(letter.charCodeAt(0) - 55));
|
|
48
|
+
return pad(98 - mod97(expanded), 2);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Mod 97 digit by digit, because an expanded IBAN overflows `Number`. */
|
|
52
|
+
function mod97(value: string): number {
|
|
53
|
+
let rest = 0;
|
|
54
|
+
for (const char of value) rest = (rest * 10 + Number(char)) % 97;
|
|
55
|
+
return rest;
|
|
56
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t } from "@venn-lang/types";
|
|
2
|
+
import type { Rng } from "../rng/index.js";
|
|
3
|
+
import { eanDigit } from "./check-digits.js";
|
|
4
|
+
import { ADJECTIVES, CATEGORIES, COLORS, MATERIALS, PRODUCTS } from "./data/index.js";
|
|
5
|
+
import type { FakerSpec } from "./faker.types.js";
|
|
6
|
+
import { capitalize, chars, digits, floatBetween, pick } from "./primitives.js";
|
|
7
|
+
|
|
8
|
+
function productName(rng: Rng): string {
|
|
9
|
+
const adjective = capitalize(pick(ADJECTIVES, rng));
|
|
10
|
+
return `${adjective} ${pick(MATERIALS, rng)} ${pick(PRODUCTS, rng)}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function sku(rng: Rng): string {
|
|
14
|
+
const letters = chars({ count: 3, alphabet: "ABCDEFGHJKLMNPQRSTUVWXYZ", rng });
|
|
15
|
+
return `${letters}-${digits(5, rng)}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** A 13-digit EAN with a real check digit, so barcode validators accept it. */
|
|
19
|
+
function barcode(rng: Rng): string {
|
|
20
|
+
const base = digits(12, rng);
|
|
21
|
+
return `${base}${eanDigit(base)}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const commerceSpecs: readonly FakerSpec[] = [
|
|
25
|
+
{
|
|
26
|
+
name: "product",
|
|
27
|
+
doc: "A product noun.",
|
|
28
|
+
result: t.string,
|
|
29
|
+
make: (rng) => pick(PRODUCTS, rng),
|
|
30
|
+
},
|
|
31
|
+
{ name: "productName", doc: "A full product name.", result: t.string, make: productName },
|
|
32
|
+
{ name: "sku", doc: "A stock keeping unit.", result: t.string, make: sku },
|
|
33
|
+
{ name: "barcode", doc: "A valid EAN-13 barcode.", result: t.string, make: barcode },
|
|
34
|
+
{
|
|
35
|
+
name: "category",
|
|
36
|
+
doc: "A product category.",
|
|
37
|
+
result: t.string,
|
|
38
|
+
make: (rng) => pick(CATEGORIES, rng),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "material",
|
|
42
|
+
doc: "A material, like `leather`.",
|
|
43
|
+
result: t.string,
|
|
44
|
+
make: (rng) => pick(MATERIALS, rng),
|
|
45
|
+
},
|
|
46
|
+
{ name: "color", doc: "A colour name.", result: t.string, make: (rng) => pick(COLORS, rng)[0] },
|
|
47
|
+
{
|
|
48
|
+
name: "hexColor",
|
|
49
|
+
doc: "A colour as a hex triplet, like `#1e88e5`.",
|
|
50
|
+
result: t.string,
|
|
51
|
+
make: (rng) => pick(COLORS, rng)[1],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "price",
|
|
55
|
+
doc: "A retail price with two decimal places.",
|
|
56
|
+
result: t.number,
|
|
57
|
+
make: (rng) => floatBetween({ min: 5, max: 500, decimals: 2, rng }),
|
|
58
|
+
},
|
|
59
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { t } from "@venn-lang/types";
|
|
2
|
+
import type { Rng } from "../rng/index.js";
|
|
3
|
+
import {
|
|
4
|
+
BUZZWORDS,
|
|
5
|
+
CATCH_VERBS,
|
|
6
|
+
COMPANY_ROOTS,
|
|
7
|
+
COMPANY_SUFFIXES,
|
|
8
|
+
DEPARTMENTS,
|
|
9
|
+
} from "./data/index.js";
|
|
10
|
+
import type { FakerSpec } from "./faker.types.js";
|
|
11
|
+
import { capitalize, pick } from "./primitives.js";
|
|
12
|
+
|
|
13
|
+
function company(rng: Rng): string {
|
|
14
|
+
return `${pick(COMPANY_ROOTS, rng)} ${pick(COMPANY_SUFFIXES, rng)}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function catchPhrase(rng: Rng): string {
|
|
18
|
+
return `${capitalize(pick(CATCH_VERBS, rng))} your ${pick(BUZZWORDS, rng)}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const companySpecs: readonly FakerSpec[] = [
|
|
22
|
+
{ name: "company", doc: "A company name.", result: t.string, make: company },
|
|
23
|
+
{
|
|
24
|
+
name: "department",
|
|
25
|
+
doc: "A department name.",
|
|
26
|
+
result: t.string,
|
|
27
|
+
make: (rng) => pick(DEPARTMENTS, rng),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "catchPhrase",
|
|
31
|
+
doc: "A marketing catch phrase.",
|
|
32
|
+
result: t.string,
|
|
33
|
+
make: catchPhrase,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "buzzword",
|
|
37
|
+
doc: "A single piece of business jargon.",
|
|
38
|
+
result: t.string,
|
|
39
|
+
make: (rng) => pick(BUZZWORDS, rng),
|
|
40
|
+
},
|
|
41
|
+
];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const COMPANY_ROOTS: readonly string[] = [
|
|
2
|
+
"Northwind",
|
|
3
|
+
"Acme",
|
|
4
|
+
"Globex",
|
|
5
|
+
"Initech",
|
|
6
|
+
"Umbrella",
|
|
7
|
+
"Vandelay",
|
|
8
|
+
"Stark",
|
|
9
|
+
"Wayne",
|
|
10
|
+
"Tyrell",
|
|
11
|
+
"Cyberdyne",
|
|
12
|
+
"Aperture",
|
|
13
|
+
"Soylent",
|
|
14
|
+
"Massive",
|
|
15
|
+
"Hooli",
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const COMPANY_SUFFIXES: readonly string[] = [
|
|
19
|
+
"Ltd",
|
|
20
|
+
"Inc",
|
|
21
|
+
"GmbH",
|
|
22
|
+
"S.A.",
|
|
23
|
+
"LLC",
|
|
24
|
+
"Group",
|
|
25
|
+
"Labs",
|
|
26
|
+
"Systems",
|
|
27
|
+
"Holdings",
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
export const DEPARTMENTS: readonly string[] = [
|
|
31
|
+
"Engineering",
|
|
32
|
+
"Design",
|
|
33
|
+
"Sales",
|
|
34
|
+
"Marketing",
|
|
35
|
+
"Support",
|
|
36
|
+
"Finance",
|
|
37
|
+
"Legal",
|
|
38
|
+
"People",
|
|
39
|
+
"Operations",
|
|
40
|
+
"Security",
|
|
41
|
+
"Data",
|
|
42
|
+
"Research",
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
export const JOB_TITLES: readonly string[] = [
|
|
46
|
+
"Software Engineer",
|
|
47
|
+
"Product Designer",
|
|
48
|
+
"Data Analyst",
|
|
49
|
+
"Engineering Manager",
|
|
50
|
+
"QA Engineer",
|
|
51
|
+
"Site Reliability Engineer",
|
|
52
|
+
"Technical Writer",
|
|
53
|
+
"Product Manager",
|
|
54
|
+
"Security Analyst",
|
|
55
|
+
"Solutions Architect",
|
|
56
|
+
"Support Specialist",
|
|
57
|
+
"Accountant",
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
export const BUZZWORDS: readonly string[] = [
|
|
61
|
+
"synergy",
|
|
62
|
+
"scalability",
|
|
63
|
+
"throughput",
|
|
64
|
+
"observability",
|
|
65
|
+
"resilience",
|
|
66
|
+
"alignment",
|
|
67
|
+
"velocity",
|
|
68
|
+
"leverage",
|
|
69
|
+
"bandwidth",
|
|
70
|
+
"runway",
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export const CATCH_VERBS: readonly string[] = [
|
|
74
|
+
"streamline",
|
|
75
|
+
"orchestrate",
|
|
76
|
+
"unlock",
|
|
77
|
+
"accelerate",
|
|
78
|
+
"simplify",
|
|
79
|
+
"amplify",
|
|
80
|
+
];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const PRODUCTS: readonly string[] = [
|
|
2
|
+
"Chair",
|
|
3
|
+
"Keyboard",
|
|
4
|
+
"Lamp",
|
|
5
|
+
"Backpack",
|
|
6
|
+
"Mug",
|
|
7
|
+
"Notebook",
|
|
8
|
+
"Headphones",
|
|
9
|
+
"Monitor",
|
|
10
|
+
"Desk",
|
|
11
|
+
"Bottle",
|
|
12
|
+
"Jacket",
|
|
13
|
+
"Sneakers",
|
|
14
|
+
"Table",
|
|
15
|
+
"Shelf",
|
|
16
|
+
"Camera",
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const MATERIALS: readonly string[] = [
|
|
20
|
+
"cotton",
|
|
21
|
+
"steel",
|
|
22
|
+
"oak",
|
|
23
|
+
"leather",
|
|
24
|
+
"glass",
|
|
25
|
+
"aluminium",
|
|
26
|
+
"ceramic",
|
|
27
|
+
"linen",
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
export const CATEGORIES: readonly string[] = [
|
|
31
|
+
"Electronics",
|
|
32
|
+
"Home",
|
|
33
|
+
"Outdoors",
|
|
34
|
+
"Books",
|
|
35
|
+
"Clothing",
|
|
36
|
+
"Toys",
|
|
37
|
+
"Grocery",
|
|
38
|
+
"Sports",
|
|
39
|
+
"Beauty",
|
|
40
|
+
"Automotive",
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export const COLORS: readonly [string, string][] = [
|
|
44
|
+
["black", "#000000"],
|
|
45
|
+
["white", "#ffffff"],
|
|
46
|
+
["red", "#e53935"],
|
|
47
|
+
["blue", "#1e88e5"],
|
|
48
|
+
["green", "#43a047"],
|
|
49
|
+
["amber", "#ffb300"],
|
|
50
|
+
["violet", "#8e24aa"],
|
|
51
|
+
["teal", "#00897b"],
|
|
52
|
+
["slate", "#546e7a"],
|
|
53
|
+
["coral", "#ff7043"],
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
/** `[code, symbol, name]`. */
|
|
57
|
+
export const CURRENCIES: readonly [string, string, string][] = [
|
|
58
|
+
["BRL", "R$", "Brazilian Real"],
|
|
59
|
+
["USD", "$", "US Dollar"],
|
|
60
|
+
["EUR", "€", "Euro"],
|
|
61
|
+
["GBP", "£", "Pound Sterling"],
|
|
62
|
+
["JPY", "¥", "Japanese Yen"],
|
|
63
|
+
["CAD", "$", "Canadian Dollar"],
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
/** `[brand, prefix, length]`. The prefixes are the real issuer ranges. */
|
|
67
|
+
export const CARD_BRANDS: readonly [string, string, number][] = [
|
|
68
|
+
["Visa", "4", 16],
|
|
69
|
+
["Mastercard", "51", 16],
|
|
70
|
+
["Mastercard", "55", 16],
|
|
71
|
+
["Discover", "6011", 16],
|
|
72
|
+
["Elo", "4011", 16],
|
|
73
|
+
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export {
|
|
2
|
+
BUZZWORDS,
|
|
3
|
+
CATCH_VERBS,
|
|
4
|
+
COMPANY_ROOTS,
|
|
5
|
+
COMPANY_SUFFIXES,
|
|
6
|
+
DEPARTMENTS,
|
|
7
|
+
JOB_TITLES,
|
|
8
|
+
} from "./business.js";
|
|
9
|
+
export { CARD_BRANDS, CATEGORIES, COLORS, CURRENCIES, MATERIALS, PRODUCTS } from "./commerce.js";
|
|
10
|
+
export {
|
|
11
|
+
FIRST_NAMES,
|
|
12
|
+
GENDERS,
|
|
13
|
+
LAST_NAMES,
|
|
14
|
+
NAME_PREFIXES,
|
|
15
|
+
NAME_SUFFIXES,
|
|
16
|
+
} from "./names.js";
|
|
17
|
+
export {
|
|
18
|
+
BR_CITIES,
|
|
19
|
+
BR_STATES,
|
|
20
|
+
BR_STREET_NAMES,
|
|
21
|
+
BR_STREET_TYPES,
|
|
22
|
+
CITIES,
|
|
23
|
+
COUNTRIES,
|
|
24
|
+
STREET_TYPES,
|
|
25
|
+
TIMEZONES,
|
|
26
|
+
} from "./places.js";
|
|
27
|
+
export {
|
|
28
|
+
HTTP_METHODS,
|
|
29
|
+
HTTP_STATUSES,
|
|
30
|
+
MIME_TYPES,
|
|
31
|
+
PROTOCOLS,
|
|
32
|
+
SAFE_DOMAINS,
|
|
33
|
+
TLDS,
|
|
34
|
+
USER_AGENTS,
|
|
35
|
+
} from "./web.js";
|
|
36
|
+
export { ADJECTIVES, LOREM, NOUNS } from "./words.js";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** Given names, mixing the computing pantheon with names common in Brazil. */
|
|
2
|
+
export const FIRST_NAMES: readonly string[] = [
|
|
3
|
+
"Ada",
|
|
4
|
+
"Alan",
|
|
5
|
+
"Grace",
|
|
6
|
+
"Linus",
|
|
7
|
+
"Edsger",
|
|
8
|
+
"Barbara",
|
|
9
|
+
"Katherine",
|
|
10
|
+
"Dennis",
|
|
11
|
+
"Margaret",
|
|
12
|
+
"Donald",
|
|
13
|
+
"Anita",
|
|
14
|
+
"Tim",
|
|
15
|
+
"Radia",
|
|
16
|
+
"Ken",
|
|
17
|
+
"Frances",
|
|
18
|
+
"Vint",
|
|
19
|
+
"Ana",
|
|
20
|
+
"Bruno",
|
|
21
|
+
"Camila",
|
|
22
|
+
"Diego",
|
|
23
|
+
"Eduarda",
|
|
24
|
+
"Felipe",
|
|
25
|
+
"Gabriela",
|
|
26
|
+
"Heitor",
|
|
27
|
+
"Isabela",
|
|
28
|
+
"João",
|
|
29
|
+
"Larissa",
|
|
30
|
+
"Mateus",
|
|
31
|
+
"Natália",
|
|
32
|
+
"Otávio",
|
|
33
|
+
"Paula",
|
|
34
|
+
"Rafael",
|
|
35
|
+
"Sofia",
|
|
36
|
+
"Thiago",
|
|
37
|
+
"Valentina",
|
|
38
|
+
"Yuri",
|
|
39
|
+
"Beatriz",
|
|
40
|
+
"Caio",
|
|
41
|
+
"Débora",
|
|
42
|
+
"Enzo",
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
/** Family names, likewise mixed. */
|
|
46
|
+
export const LAST_NAMES: readonly string[] = [
|
|
47
|
+
"Lovelace",
|
|
48
|
+
"Turing",
|
|
49
|
+
"Hopper",
|
|
50
|
+
"Torvalds",
|
|
51
|
+
"Dijkstra",
|
|
52
|
+
"Liskov",
|
|
53
|
+
"Johnson",
|
|
54
|
+
"Ritchie",
|
|
55
|
+
"Hamilton",
|
|
56
|
+
"Knuth",
|
|
57
|
+
"Borg",
|
|
58
|
+
"Berners-Lee",
|
|
59
|
+
"Perlman",
|
|
60
|
+
"Thompson",
|
|
61
|
+
"Allen",
|
|
62
|
+
"Cerf",
|
|
63
|
+
"Silva",
|
|
64
|
+
"Santos",
|
|
65
|
+
"Oliveira",
|
|
66
|
+
"Souza",
|
|
67
|
+
"Rodrigues",
|
|
68
|
+
"Ferreira",
|
|
69
|
+
"Almeida",
|
|
70
|
+
"Costa",
|
|
71
|
+
"Gomes",
|
|
72
|
+
"Martins",
|
|
73
|
+
"Araújo",
|
|
74
|
+
"Melo",
|
|
75
|
+
"Barbosa",
|
|
76
|
+
"Ribeiro",
|
|
77
|
+
"Carvalho",
|
|
78
|
+
"Pereira",
|
|
79
|
+
"Lima",
|
|
80
|
+
"Moreira",
|
|
81
|
+
"Cardoso",
|
|
82
|
+
"Teixeira",
|
|
83
|
+
"Correia",
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
/** Honorifics that precede a name. */
|
|
87
|
+
export const NAME_PREFIXES: readonly string[] = ["Dr.", "Dra.", "Sr.", "Sra.", "Prof.", "Eng."];
|
|
88
|
+
|
|
89
|
+
/** Generational suffixes that follow a name. */
|
|
90
|
+
export const NAME_SUFFIXES: readonly string[] = ["Jr.", "Neto", "Filho", "II", "III"];
|
|
91
|
+
|
|
92
|
+
/** Gender values shaped the way most forms model them. */
|
|
93
|
+
export const GENDERS: readonly string[] = ["female", "male", "non-binary", "prefer not to say"];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export const CITIES: readonly string[] = [
|
|
2
|
+
"Lisbon",
|
|
3
|
+
"Porto",
|
|
4
|
+
"Amsterdam",
|
|
5
|
+
"Berlin",
|
|
6
|
+
"Toronto",
|
|
7
|
+
"Austin",
|
|
8
|
+
"Dublin",
|
|
9
|
+
"Wellington",
|
|
10
|
+
"Reykjavík",
|
|
11
|
+
"Kyoto",
|
|
12
|
+
"Montréal",
|
|
13
|
+
"Helsinki",
|
|
14
|
+
"Tallinn",
|
|
15
|
+
"Bergen",
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const COUNTRIES: readonly [string, string][] = [
|
|
19
|
+
["Brazil", "BR"],
|
|
20
|
+
["Portugal", "PT"],
|
|
21
|
+
["Netherlands", "NL"],
|
|
22
|
+
["Germany", "DE"],
|
|
23
|
+
["Canada", "CA"],
|
|
24
|
+
["United States", "US"],
|
|
25
|
+
["Ireland", "IE"],
|
|
26
|
+
["New Zealand", "NZ"],
|
|
27
|
+
["Japan", "JP"],
|
|
28
|
+
["Finland", "FI"],
|
|
29
|
+
["Estonia", "EE"],
|
|
30
|
+
["Norway", "NO"],
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export const STREET_TYPES: readonly string[] = [
|
|
34
|
+
"Street",
|
|
35
|
+
"Avenue",
|
|
36
|
+
"Road",
|
|
37
|
+
"Lane",
|
|
38
|
+
"Way",
|
|
39
|
+
"Square",
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export const TIMEZONES: readonly string[] = [
|
|
43
|
+
"America/Sao_Paulo",
|
|
44
|
+
"America/New_York",
|
|
45
|
+
"Europe/Lisbon",
|
|
46
|
+
"Europe/Berlin",
|
|
47
|
+
"Europe/Helsinki",
|
|
48
|
+
"Asia/Tokyo",
|
|
49
|
+
"Pacific/Auckland",
|
|
50
|
+
"UTC",
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
/** Brazilian federal units, as `[name, code]`. */
|
|
54
|
+
export const BR_STATES: readonly [string, string][] = [
|
|
55
|
+
["São Paulo", "SP"],
|
|
56
|
+
["Rio de Janeiro", "RJ"],
|
|
57
|
+
["Minas Gerais", "MG"],
|
|
58
|
+
["Bahia", "BA"],
|
|
59
|
+
["Paraná", "PR"],
|
|
60
|
+
["Rio Grande do Sul", "RS"],
|
|
61
|
+
["Pernambuco", "PE"],
|
|
62
|
+
["Ceará", "CE"],
|
|
63
|
+
["Santa Catarina", "SC"],
|
|
64
|
+
["Goiás", "GO"],
|
|
65
|
+
["Pará", "PA"],
|
|
66
|
+
["Espírito Santo", "ES"],
|
|
67
|
+
["Amazonas", "AM"],
|
|
68
|
+
["Distrito Federal", "DF"],
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
export const BR_CITIES: readonly string[] = [
|
|
72
|
+
"São Paulo",
|
|
73
|
+
"Rio de Janeiro",
|
|
74
|
+
"Belo Horizonte",
|
|
75
|
+
"Salvador",
|
|
76
|
+
"Curitiba",
|
|
77
|
+
"Porto Alegre",
|
|
78
|
+
"Recife",
|
|
79
|
+
"Fortaleza",
|
|
80
|
+
"Florianópolis",
|
|
81
|
+
"Goiânia",
|
|
82
|
+
"Belém",
|
|
83
|
+
"Vitória",
|
|
84
|
+
"Manaus",
|
|
85
|
+
"Brasília",
|
|
86
|
+
"Campinas",
|
|
87
|
+
"Uberlândia",
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
export const BR_STREET_TYPES: readonly string[] = [
|
|
91
|
+
"Rua",
|
|
92
|
+
"Avenida",
|
|
93
|
+
"Travessa",
|
|
94
|
+
"Alameda",
|
|
95
|
+
"Praça",
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
export const BR_STREET_NAMES: readonly string[] = [
|
|
99
|
+
"das Flores",
|
|
100
|
+
"Sete de Setembro",
|
|
101
|
+
"Getúlio Vargas",
|
|
102
|
+
"XV de Novembro",
|
|
103
|
+
"Santos Dumont",
|
|
104
|
+
"do Comércio",
|
|
105
|
+
"Paulista",
|
|
106
|
+
"Brasil",
|
|
107
|
+
"das Palmeiras",
|
|
108
|
+
"Tiradentes",
|
|
109
|
+
];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Reserved by RFC 2606/6761, so a generated address never resolves to anyone real. */
|
|
2
|
+
export const SAFE_DOMAINS: readonly string[] = [
|
|
3
|
+
"example.test",
|
|
4
|
+
"example.com",
|
|
5
|
+
"example.org",
|
|
6
|
+
"example.net",
|
|
7
|
+
"test.invalid",
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export const TLDS: readonly string[] = ["com", "org", "net", "io", "dev", "app", "com.br"];
|
|
11
|
+
|
|
12
|
+
export const HTTP_METHODS: readonly string[] = [
|
|
13
|
+
"GET",
|
|
14
|
+
"POST",
|
|
15
|
+
"PUT",
|
|
16
|
+
"PATCH",
|
|
17
|
+
"DELETE",
|
|
18
|
+
"HEAD",
|
|
19
|
+
"OPTIONS",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export const HTTP_STATUSES: readonly number[] = [
|
|
23
|
+
200, 201, 202, 204, 301, 302, 304, 400, 401, 403, 404, 409, 422, 429, 500, 502, 503,
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export const MIME_TYPES: readonly string[] = [
|
|
27
|
+
"application/json",
|
|
28
|
+
"text/html",
|
|
29
|
+
"text/plain",
|
|
30
|
+
"text/csv",
|
|
31
|
+
"application/pdf",
|
|
32
|
+
"image/png",
|
|
33
|
+
"image/jpeg",
|
|
34
|
+
"image/svg+xml",
|
|
35
|
+
"application/octet-stream",
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export const USER_AGENTS: readonly string[] = [
|
|
39
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",
|
|
40
|
+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15",
|
|
41
|
+
"Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0",
|
|
42
|
+
"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
export const PROTOCOLS: readonly string[] = ["https", "http"];
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** Classic lorem vocabulary: filler text that is obviously filler. */
|
|
2
|
+
export const LOREM: readonly string[] = [
|
|
3
|
+
"lorem",
|
|
4
|
+
"ipsum",
|
|
5
|
+
"dolor",
|
|
6
|
+
"sit",
|
|
7
|
+
"amet",
|
|
8
|
+
"consectetur",
|
|
9
|
+
"adipiscing",
|
|
10
|
+
"elit",
|
|
11
|
+
"sed",
|
|
12
|
+
"do",
|
|
13
|
+
"eiusmod",
|
|
14
|
+
"tempor",
|
|
15
|
+
"incididunt",
|
|
16
|
+
"ut",
|
|
17
|
+
"labore",
|
|
18
|
+
"et",
|
|
19
|
+
"dolore",
|
|
20
|
+
"magna",
|
|
21
|
+
"aliqua",
|
|
22
|
+
"enim",
|
|
23
|
+
"ad",
|
|
24
|
+
"minim",
|
|
25
|
+
"veniam",
|
|
26
|
+
"quis",
|
|
27
|
+
"nostrud",
|
|
28
|
+
"exercitation",
|
|
29
|
+
"ullamco",
|
|
30
|
+
"laboris",
|
|
31
|
+
"nisi",
|
|
32
|
+
"aliquip",
|
|
33
|
+
"ex",
|
|
34
|
+
"ea",
|
|
35
|
+
"commodo",
|
|
36
|
+
"consequat",
|
|
37
|
+
"duis",
|
|
38
|
+
"aute",
|
|
39
|
+
"irure",
|
|
40
|
+
"in",
|
|
41
|
+
"reprehenderit",
|
|
42
|
+
"voluptate",
|
|
43
|
+
"velit",
|
|
44
|
+
"esse",
|
|
45
|
+
"cillum",
|
|
46
|
+
"eu",
|
|
47
|
+
"fugiat",
|
|
48
|
+
"nulla",
|
|
49
|
+
"pariatur",
|
|
50
|
+
"excepteur",
|
|
51
|
+
"sint",
|
|
52
|
+
"occaecat",
|
|
53
|
+
"cupidatat",
|
|
54
|
+
"non",
|
|
55
|
+
"proident",
|
|
56
|
+
"culpa",
|
|
57
|
+
"officia",
|
|
58
|
+
"deserunt",
|
|
59
|
+
"mollit",
|
|
60
|
+
"anim",
|
|
61
|
+
"id",
|
|
62
|
+
"est",
|
|
63
|
+
"laborum",
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
/** Adjectives, for product and project names. */
|
|
67
|
+
export const ADJECTIVES: readonly string[] = [
|
|
68
|
+
"quiet",
|
|
69
|
+
"bright",
|
|
70
|
+
"rapid",
|
|
71
|
+
"solid",
|
|
72
|
+
"gentle",
|
|
73
|
+
"bold",
|
|
74
|
+
"clever",
|
|
75
|
+
"plain",
|
|
76
|
+
"sturdy",
|
|
77
|
+
"sleek",
|
|
78
|
+
"warm",
|
|
79
|
+
"crisp",
|
|
80
|
+
"amber",
|
|
81
|
+
"hollow",
|
|
82
|
+
"northern",
|
|
83
|
+
"silent",
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
/** Concrete nouns, for the same. */
|
|
87
|
+
export const NOUNS: readonly string[] = [
|
|
88
|
+
"harbour",
|
|
89
|
+
"lantern",
|
|
90
|
+
"meadow",
|
|
91
|
+
"compass",
|
|
92
|
+
"anchor",
|
|
93
|
+
"ridge",
|
|
94
|
+
"beacon",
|
|
95
|
+
"quarry",
|
|
96
|
+
"willow",
|
|
97
|
+
"falcon",
|
|
98
|
+
"cascade",
|
|
99
|
+
"summit",
|
|
100
|
+
"orchard",
|
|
101
|
+
"canyon",
|
|
102
|
+
"delta",
|
|
103
|
+
"ember",
|
|
104
|
+
];
|