Skip to content

Commit

Permalink
chore: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Aug 1, 2023
1 parent a12b9bd commit 0973c6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Options } from './options'

export type Request = {
type: 'image' | 'text'
resovle?: (response: string) => void
resolve?: (response: string) => void
reject?: (error: Error) => void
response: Promise<string>
}
Expand Down
2 changes: 1 addition & 1 deletion src/create-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function createContext<T extends Node>(node: T, options?: Options &
worker.onmessage = async event => {
const { url, result } = event.data
if (result) {
requests.get(url)?.resovle?.(result)
requests.get(url)?.resolve?.(result)
} else {
requests.get(url)?.reject?.(new Error(`Error receiving message from worker: ${ url }`))
}
Expand Down
4 changes: 2 additions & 2 deletions src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function contextFetch(context: Context, options: ContextFetchOptions) {

request = {
type: requestType,
resovle: undefined,
resolve: undefined,
reject: undefined,
response: null as any,
}
Expand All @@ -85,7 +85,7 @@ export function contextFetch(context: Context, options: ContextFetchOptions) {
? new Promise((resolve, reject) => {
const worker = workers[requests.size & (workers.length - 1)]
worker.postMessage({ rawUrl, ...baseFetchOptions })
request!.resovle = resolve
request!.resolve = resolve
request!.reject = reject
})
: baseFetch(baseFetchOptions)
Expand Down

1 comment on commit 0973c6c

@vercel
Copy link

@vercel vercel bot commented on 0973c6c Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

modern-screenshot – ./

modern-screenshot-git-main-qq15725.vercel.app
modern-screenshot-qq15725.vercel.app
modern-screenshot.vercel.app

Please sign in to comment.