Skip to content

Commit 3f8831c

Browse files
committed
Format (publish)
1 parent 3b9ed5c commit 3f8831c

File tree

4 files changed

+77
-79
lines changed

4 files changed

+77
-79
lines changed

.eslintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
},
77
"plugins": ["@typescript-eslint/eslint-plugin"],
88
"extends": [
9-
"plugin:@typescript-eslint/eslint-recommended",
10-
"plugin:@typescript-eslint/recommended",
11-
"prettier",
12-
"prettier/@typescript-eslint"
9+
"prettier"
1310
],
1411
"root": true,
1512
"env": {

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
# 📦 Installation
2626

27-
- Using yarn: `yarn add react-use-lanyard`
28-
- Using npm: `npm i react-use-lanyard`
27+
- Using yarn: `yarn add react-use-lanyard`
28+
- Using npm: `npm i react-use-lanyard`
2929

3030
# 🤓 Usage
3131

@@ -153,11 +153,10 @@ Give a ⭐️ if this project helped you!
153153

154154
# 📞 Contact
155155

156-
157-
- Discord: https://discord.gg/BjEJFwh
158-
- Instagram: https://www.instagram.com/ben_baris.d/
156+
157+
- Discord: https://discord.gg/BjEJFwh
159158

160159
# ✨ Special Thanks
161160

162-
- [Phineas](https://github.com/Phineas) - Creator of [Lanyard API](https://github.com/Phineas/lanyard)
163-
- [Eggsy](https://github.com/eggsy) - Creator of [vue-lanyard](https://www.npmjs.com/package/@eggsydev/vue-lanyard)
161+
- [Phineas](https://github.com/Phineas) - Creator of [Lanyard API](https://github.com/Phineas/lanyard)
162+
- [Eggsy](https://github.com/eggsy) - Creator of [vue-lanyard](https://www.npmjs.com/package/@eggsydev/vue-lanyard)

package.json

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
{
2-
"name": "react-use-lanyard",
3-
"version": "0.3.2",
4-
"main": "dist",
5-
"typings": "dist",
6-
"repository": {
7-
"type": "git",
8-
"url": "https://github.com/barbarbar338/react-use-lanyard"
9-
},
10-
"author": {
11-
"email": "[email protected]",
12-
"name": "Barış DEMİRCİ",
13-
"url": "https://338.rocks/"
14-
},
15-
"license": "GPL-3.0",
16-
"description": "🚀 Use Lanyard API easily in you React app!",
17-
"scripts": {
18-
"prebuild": "rimraf dist",
19-
"build": "tsc",
20-
"format": "prettier --write .",
21-
"lint": "eslint --fix .",
22-
"update": "taze latest -w"
23-
},
24-
"devDependencies": {
25-
"@types/node": "^20.10.4",
26-
"@types/react": "^18.2.43",
27-
"@types/react-dom": "^18.2.17",
28-
"@typescript-eslint/eslint-plugin": "^6.13.2",
29-
"@typescript-eslint/parser": "^6.13.2",
30-
"eslint": "^8.55.0",
31-
"eslint-config-prettier": "^9.1.0",
32-
"eslint-plugin-import": "^2.29.0",
33-
"prettier": "^3.1.1",
34-
"react": "^18.2.0",
35-
"react-dom": "^18.2.0",
36-
"taze": "^0.13.0",
37-
"ts-node": "^10.9.2",
38-
"typescript": "^5.3.3"
39-
},
40-
"peerDependencies": {
41-
"react": ">=16"
42-
},
43-
"dependencies": {
44-
"swr": "^2.2.4",
45-
"tslib": "^2.6.2"
46-
}
47-
}
1+
{
2+
"name": "react-use-lanyard",
3+
"version": "0.3.3",
4+
"main": "dist",
5+
"typings": "dist",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/barbarbar338/react-use-lanyard"
9+
},
10+
"author": {
11+
"email": "[email protected]",
12+
"name": "Barış DEMİRCİ",
13+
"url": "https://338.rocks/"
14+
},
15+
"license": "GPL-3.0",
16+
"description": "🚀 Use Lanyard API easily in you React app!",
17+
"scripts": {
18+
"prebuild": "rimraf dist",
19+
"build": "tsc",
20+
"format": "prettier --write .",
21+
"lint": "eslint --fix ./src/**/*",
22+
"update": "taze latest -w"
23+
},
24+
"devDependencies": {
25+
"@types/node": "^20.10.4",
26+
"@types/react": "^18.2.43",
27+
"@types/react-dom": "^18.2.17",
28+
"@typescript-eslint/eslint-plugin": "^6.13.2",
29+
"@typescript-eslint/parser": "^6.13.2",
30+
"eslint": "^8.55.0",
31+
"eslint-config-prettier": "^9.1.0",
32+
"eslint-plugin-import": "^2.29.0",
33+
"prettier": "^3.1.1",
34+
"react": "^18.2.0",
35+
"react-dom": "^18.2.0",
36+
"taze": "^0.13.0",
37+
"ts-node": "^10.9.2",
38+
"typescript": "^5.3.3"
39+
},
40+
"peerDependencies": {
41+
"react": ">=16"
42+
},
43+
"dependencies": {
44+
"swr": "^2.2.4",
45+
"tslib": "^2.6.2"
46+
}
47+
}

src/types.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export interface LanyardWebsocket {
2323
export type LanyardGeneric<T> = T extends { socket: true }
2424
? LanyardWebsocket
2525
: T extends { userId: string }
26-
? LanyardSWRSingle
27-
: T extends { userId: string[] }
28-
? LanyardSWRMultiple
29-
: never;
26+
? LanyardSWRSingle
27+
: T extends { userId: string[] }
28+
? LanyardSWRMultiple
29+
: never;
3030

3131
/**
3232
* Special thanks to @eggsy
@@ -59,26 +59,28 @@ export type LanyardData = {
5959
active_on_discord_mobile: boolean;
6060
active_on_discord_desktop: boolean;
6161
active_on_discord_embedded: boolean;
62-
} & Spotify
62+
} & Spotify;
6363

6464
export interface Kv {
6565
[key: string]: string;
6666
}
6767

68-
export type Spotify = {
69-
lintening_to_spotify: true,
70-
spotify: {
71-
track_id: string;
72-
timestamps: Timestamps;
73-
song: string;
74-
artist: string;
75-
album_art_url: string;
76-
album: string;
77-
}
78-
} | {
79-
listening_to_spotify: false,
80-
spotify: null
81-
}
68+
export type Spotify =
69+
| {
70+
lintening_to_spotify: true;
71+
spotify: {
72+
track_id: string;
73+
timestamps: Timestamps;
74+
song: string;
75+
artist: string;
76+
album_art_url: string;
77+
album: string;
78+
};
79+
}
80+
| {
81+
listening_to_spotify: false;
82+
spotify: null;
83+
};
8284

8385
export interface Timestamps {
8486
start: number;
@@ -138,7 +140,7 @@ export interface DiscordUser {
138140
asset: string;
139141
expires_at: number;
140142
} | null;
141-
clan: null; // clan object deprecated
143+
clan: null; // clan object deprecated
142144
primary_guild: {
143145
tag: string;
144146
identity_guild_id: string;
@@ -154,4 +156,4 @@ export interface DiscordUser {
154156
palette: string;
155157
};
156158
} | null;
157-
}
159+
}

0 commit comments

Comments
 (0)