Skip to content

Commit 2a0b3d2

Browse files
committed
chore(discord-player): release 6.6.8
1 parent 0441e01 commit 2a0b3d2

File tree

4 files changed

+19
-29
lines changed

4 files changed

+19
-29
lines changed

apps/website/src/data/docs.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/discord-player/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "discord-player",
3-
"version": "6.6.7",
3+
"version": "6.6.8",
44
"description": "Complete framework to facilitate music commands using discord.js",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -55,7 +55,7 @@
5555
"@discord-player/utils": "workspace:^",
5656
"discord-voip": "^0.1.3",
5757
"ip": "^1.1.8",
58-
"libsodium-wrappers": "^0.7.10"
58+
"libsodium-wrappers": "^0.7.13"
5959
},
6060
"peerDependencies": {
6161
"@discord-player/extractor": "workspace:^"

packages/discord-player/src/hooks/context/async-context.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@ type unsafe = any;
88
*/
99
export type ContextReceiver<R> = () => R;
1010

11-
/**
12-
* The props for the context provider
13-
*/
14-
export interface ContextProviderProps<T, R> {
15-
/**
16-
* The value to provide
17-
*/
18-
value: T;
19-
/**
20-
* The receiver function that will be called when the context is provided
21-
*/
22-
receiver: ContextReceiver<R>;
23-
}
24-
2511
export class Context<T> {
2612
private storage = new AsyncLocalStorage<T>();
2713

@@ -55,11 +41,15 @@ export class Context<T> {
5541
/**
5642
* Run a function within the context of this provider
5743
*/
58-
public provide<R = unsafe>({ receiver, value }: ContextProviderProps<T, R>): R {
44+
public provide<R = unsafe>(value: T, receiver: ContextReceiver<R>): R {
5945
if (value === undefined) {
6046
throw new Error('Context value may not be undefined');
6147
}
6248

49+
if (typeof receiver !== 'function') {
50+
throw new Error('Context receiver must be a function');
51+
}
52+
6353
return this.storage.run(value, receiver);
6454
}
6555
}
@@ -76,7 +66,7 @@ export class Context<T> {
7666
* };
7767
*
7868
* // provide the context value to the receiver
79-
* context.provide({ value: user, receiver: handler });
69+
* context.provide(user, handler);
8070
*
8171
* function handler() {
8272
* // get the context value

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4896,7 +4896,7 @@ __metadata:
48964896
discord-voip: "npm:^0.1.3"
48974897
discord.js: "npm:^14.1.2"
48984898
ip: "npm:^1.1.8"
4899-
libsodium-wrappers: "npm:^0.7.10"
4899+
libsodium-wrappers: "npm:^0.7.13"
49004900
opusscript: "npm:^0.0.8"
49014901
tsup: "npm:^7.2.0"
49024902
typescript: "npm:^5.2.2"
@@ -7444,19 +7444,19 @@ __metadata:
74447444
languageName: node
74457445
linkType: hard
74467446

7447-
"libsodium-wrappers@npm:^0.7.10":
7448-
version: 0.7.10
7449-
resolution: "libsodium-wrappers@npm:0.7.10"
7447+
"libsodium-wrappers@npm:^0.7.13":
7448+
version: 0.7.13
7449+
resolution: "libsodium-wrappers@npm:0.7.13"
74507450
dependencies:
7451-
libsodium: "npm:^0.7.0"
7452-
checksum: 7bba87d464bc914d57bec85c9901529746b706083ffdba1642f2860a11a4f71351fecb94406330c5c0cc6ec493ebc019a706a70d976ba508831d63a93236c44f
7451+
libsodium: "npm:^0.7.13"
7452+
checksum: e5f7f5baf37095a764e3f5037ab47d65343db0c0efca4add80a5c2037ac2cb9fb05f00646f7b75220bd4f30bccc02e9742603ceb8eb97e5c305103cd4f86392d
74537453
languageName: node
74547454
linkType: hard
74557455

7456-
"libsodium@npm:^0.7.0":
7457-
version: 0.7.9
7458-
resolution: "libsodium@npm:0.7.9"
7459-
checksum: 3ad30dc469fad658d716f4160a8b2143e9f7337bbaef6fe9a983b6611f2f68f6f2fc094b53e73dc79a3b1e810fafff768609ab885f151469cff5a4372ae4a586
7456+
"libsodium@npm:^0.7.13":
7457+
version: 0.7.13
7458+
resolution: "libsodium@npm:0.7.13"
7459+
checksum: 0105523135c1ed1c4ee853a36cd3b3b562ed150f5888ae61be4b2945f0b1010e7ecaad4cdc9333beac034a88bdf470a93f22609877a06f15f5d690a9591e0d7c
74607460
languageName: node
74617461
linkType: hard
74627462

0 commit comments

Comments
 (0)