diff --git a/src/client.ts b/src/client.ts index 505d940..89dcab0 100644 --- a/src/client.ts +++ b/src/client.ts @@ -70,7 +70,7 @@ export interface ClientOptions { */ lazy?: SingleConnection extends true ? boolean : never; /** - * How long should the client wait before closing the connection after the last oparation has + * How long should the client wait before closing the connection after the last operation has * completed. You might want to have a calmdown time before actually closing the connection. * * Meant to be used in combination with `lazy`. @@ -215,7 +215,7 @@ export interface ClientOptions { */ onMessage?: (message: StreamMessage) => void; /** - * Event listeners for events happening in teh SSE connection. + * Event listeners for events happening in the SSE connection. * * Will emit events for both the "single connection mode" and the default "distinct connections mode". * @@ -796,7 +796,7 @@ export class NetworkError< Response extends ResponseLike = ResponseLike, > extends Error { /** - * The underlyig response thats considered an error. + * The underlying response that's considered an error. * * Will be undefined when no response is received, * instead an unexpected network error. diff --git a/src/common.ts b/src/common.ts index c1c5f53..020b7d1 100644 --- a/src/common.ts +++ b/src/common.ts @@ -146,14 +146,14 @@ export function parseStreamData( export interface Sink { /** Next value arriving. */ next(value: T): void; - /** An error that has occured. This function "closes" the sink. */ + /** An error that has occurred. This function "closes" the sink. */ error(error: unknown): void; /** The sink has completed. This function "closes" the sink. */ complete(): void; } /** - * Checkes whether the provided value is an async iterable. + * Checks whether the provided value is an async iterable. * * @category Common */ @@ -162,7 +162,7 @@ export function isAsyncIterable(val: unknown): val is AsyncIterable { } /** - * Checkes whether the provided value is an async generator. + * Checks whether the provided value is an async generator. * * @category Common */ diff --git a/src/handler.ts b/src/handler.ts index 5f0597a..0703eae 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -117,7 +117,7 @@ export type Response = readonly [body: ResponseBody | null, init: ResponseInit]; /** * A concrete GraphQL execution context value type. * - * Mainly used because TypeScript collapes unions + * Mainly used because TypeScript collapses unions * with `any` or `unknown` to `any` or `unknown`. So, * we use a custom type to allow definitions such as * the `context` server option. @@ -271,7 +271,7 @@ export interface HandlerOptions< | void; /** * Executed after the operation call resolves. For streaming - * operations, triggering this callback does not necessarely + * operations, triggering this callback does not necessarily * mean that there is already a result available - it means * that the subscription process for the stream has resolved * and that the client is now subscribed. @@ -343,7 +343,7 @@ export type Handler = ( ) => Promise; /** - * Makes a Protocol complient HTTP GraphQL server handler. The handler can + * Makes a Protocol compliant HTTP GraphQL server handler. The handler can * be used with your favourite server library. * * Read more about the Protocol in the PROTOCOL.md documentation file. @@ -1038,13 +1038,13 @@ async function parseReq( if (!isObject(data)) { throw new Error('JSON body must be an object'); } - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be chacked below. + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be checked below. params.operationName = data.operationName as any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be chacked below. + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be checked below. params.query = data.query as any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be chacked below. + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be checked below. params.variables = data.variables as any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be chacked below. + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Any is ok because values will be checked below. params.extensions = data.extensions as any; break; } diff --git a/src/parser.ts b/src/parser.ts index cbaa93a..c157b20 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -13,7 +13,7 @@ import { enum ControlChars { NewLine = 10, - CchunkiageReturn = 13, + CarriageReturn = 13, Space = 32, Colon = 58, } @@ -69,7 +69,7 @@ export function createParser(): ( } break; // \r case below should fallthrough to \n: - case ControlChars.CchunkiageReturn: + case ControlChars.CarriageReturn: discardTrailingNewline = true; // eslint-disable-next-line no-fallthrough case ControlChars.NewLine: diff --git a/tests/utils/testkit.ts b/tests/utils/testkit.ts index b7470b8..18c6cb1 100644 --- a/tests/utils/testkit.ts +++ b/tests/utils/testkit.ts @@ -5,7 +5,7 @@ export function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); } -export type OnOpeartionArgs< +export type OnOperationArgs< RequestRaw = unknown, RequestContext = unknown, Context extends OperationContext = undefined, @@ -21,7 +21,7 @@ export interface TestKit< Context extends OperationContext = undefined, > { waitForOperation(): Promise< - OnOpeartionArgs + OnOperationArgs >; } @@ -33,7 +33,7 @@ export function injectTestKit< opts: Partial> = {}, ): TestKit { const onOperation = - queue>(); + queue>(); const origOnOperation = opts.onOperation; opts.onOperation = async (...args) => { onOperation.add(args);