Skip to content

Commit

Permalink
Add explicit undefineds
Browse files Browse the repository at this point in the history
  • Loading branch information
Wundero committed Dec 12, 2024
1 parent aa696ac commit 08756ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,19 @@ export interface SinkOptions {
/**
* The Sinkr url to connect to.
*/
url?: string;
url?: string | undefined;
/**
* The Sinkr app to use.
*/
appId?: string;
appId?: string | undefined;
}

/**
* Connect to a Sinkr server over websockets.
* @param options The connection options to use.
* @returns The connected Sinkr client.
*/
export function sink(options: SinkOptions = {}): Sinker {
export function sink(options: SinkOptions | undefined = {}): Sinker {
const url = options.url ?? process.env.SINKR_URL;
if (!url) {
throw new Error("Unable to start Sinkr without a url!");
Expand Down
12 changes: 7 additions & 5 deletions packages/core/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,13 @@ export function source({
url = process.env.SINKR_URL,
appKey = process.env.SINKER_APP_KEY,
appId = process.env.SINKR_APP_ID,
}: {
url?: string;
appKey?: string;
appId?: string;
} = {}): SinkrSource {
}:
| {
url?: string | undefined;
appKey?: string | undefined;
appId?: string | undefined;
}
| undefined = {}): SinkrSource {
if (!url) {
throw new Error("Unable to start Sourcerer without a url!");
}
Expand Down

0 comments on commit 08756ec

Please sign in to comment.