Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Sep 9, 2024
1 parent 4e4af4a commit 6c2801a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/src/singletons/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const setFetchImplementation = (fetch: (...args: any[]) => any) => {
(globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;
};

export const getFetchImplementation = () => {
export const getFetchImplementation: () => (...args: any[]) => any = () => {
return (
(globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ??
DEFAULT_FETCH_IMPLEMENTATION
Expand Down
5 changes: 3 additions & 2 deletions js/src/utils/async_caller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ export class AsyncCaller {

fetch(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {
return this.call(() =>
getFetchImplementation()(...args).then((res) =>
res.ok ? res : Promise.reject(res)
getFetchImplementation()(...args).then(
(res: Awaited<ReturnType<typeof fetch>>) =>
res.ok ? res : Promise.reject(res)
)
);
}
Expand Down

0 comments on commit 6c2801a

Please sign in to comment.