@ovencord/formatters 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -20
- package/src/escapers.ts +0 -2
- package/src/formatters.ts +1 -3
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@ovencord/formatters",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.3",
|
|
5
5
|
"description": "A set of functions to format strings for Discord.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "bun test",
|
|
8
8
|
"typecheck": "tsc --noEmit",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "biome check .",
|
|
10
|
+
"format": "biome format --write .",
|
|
11
|
+
"check": "biome check --write ."
|
|
10
12
|
},
|
|
11
13
|
"exports": "./src/index.ts",
|
|
12
14
|
"main": "./src/index.ts",
|
|
@@ -31,26 +33,11 @@
|
|
|
31
33
|
"homepage": "https://ovencord.dev",
|
|
32
34
|
"funding": "https://github.com/ovencord/ovencord?sponsor",
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"discord-api-types": "^0.38.
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@ovencord/api-extractor": "^7.52.7",
|
|
38
|
-
"@ovencord/scripts": "^0.1.0",
|
|
39
|
-
"@favware/cliff-jumper": "^6.0.0",
|
|
40
|
-
"@vitest/coverage-v8": "^4.0.15",
|
|
41
|
-
"cross-env": "^10.1.0",
|
|
42
|
-
"esbuild-plugin-version-injector": "^1.2.1",
|
|
43
|
-
"eslint": "^9.39.2",
|
|
44
|
-
"eslint-formatter-compact": "^9.0.1",
|
|
45
|
-
"eslint-formatter-pretty": "^7.0.0",
|
|
46
|
-
"prettier": "^3.7.4",
|
|
47
|
-
"typescript": "^5.9.3",
|
|
48
|
-
"vitest": "^4.0.15",
|
|
49
|
-
"@types/bun": "latest",
|
|
50
|
-
"typescript-eslint": "^8.54.0"
|
|
36
|
+
"discord-api-types": "^0.38.40"
|
|
51
37
|
},
|
|
38
|
+
"devDependencies": {},
|
|
52
39
|
"engines": {
|
|
53
|
-
"bun": ">=1.
|
|
40
|
+
"bun": ">=1.3.0"
|
|
54
41
|
},
|
|
55
42
|
"publishConfig": {
|
|
56
43
|
"access": "public"
|
package/src/escapers.ts
CHANGED
package/src/formatters.ts
CHANGED
|
@@ -520,7 +520,6 @@ export function heading<Content extends string>(content: Content, level: Heading
|
|
|
520
520
|
export function heading<Content extends string>(content: Content, level: HeadingLevel.Three): `### ${Content}`;
|
|
521
521
|
|
|
522
522
|
export function heading(content: string, level?: HeadingLevel) {
|
|
523
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
524
523
|
switch (level) {
|
|
525
524
|
case HeadingLevel.Three:
|
|
526
525
|
return `### ${content}`;
|
|
@@ -617,7 +616,6 @@ export function time<Seconds extends number, Style extends TimestampStylesString
|
|
|
617
616
|
|
|
618
617
|
export function time(timeOrSeconds?: Date | number, style?: TimestampStylesString): string {
|
|
619
618
|
if (typeof timeOrSeconds !== 'number') {
|
|
620
|
-
// eslint-disable-next-line no-param-reassign
|
|
621
619
|
timeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1_000);
|
|
622
620
|
}
|
|
623
621
|
|
|
@@ -687,7 +685,7 @@ export function email<Email extends string>(
|
|
|
687
685
|
export function email<Email extends string>(email: Email, headers?: Record<string, string | readonly string[]>) {
|
|
688
686
|
if (headers) {
|
|
689
687
|
const searchParams = new URLSearchParams(
|
|
690
|
-
Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])),
|
|
688
|
+
Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])) as Record<string, string>,
|
|
691
689
|
);
|
|
692
690
|
|
|
693
691
|
return `<${email}?${searchParams.toString()}>` as const;
|