Skip to content

Commit

Permalink
chore(internal): export helper from core (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Sep 6, 2023
1 parent 902b8aa commit 01dc5e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ const isAbsoluteURL = (url: string): boolean => {
return startsWithSchemeRegexp.test(url);
};

const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

const validatePositiveInteger = (name: string, n: unknown): number => {
if (typeof n !== 'number' || !Number.isInteger(n)) {
Expand Down
4 changes: 2 additions & 2 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export class APIConnectionError extends APIError {
}

export class APIConnectionTimeoutError extends APIConnectionError {
constructor() {
super({ message: 'Request timed out.' });
constructor({ message }: { message?: string } = {}) {
super({ message: message ?? 'Request timed out.' });
}
}

Expand Down

0 comments on commit 01dc5e2

Please sign in to comment.