Skip to content

Commit

Permalink
chore(internal): export helper from core (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and rattrayalex committed Sep 12, 2023
1 parent b1e8dd2 commit 80948cb
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 @@ -901,7 +901,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 80948cb

Please sign in to comment.