Skip to content

Commit

Permalink
docs: fix typos (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
eoyoa authored Jul 12, 2024
1 parent b20487f commit 98d5b7f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface ClientOptions<SingleConnection extends boolean = false> {
*/
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`.
Expand Down Expand Up @@ -215,7 +215,7 @@ export interface ClientOptions<SingleConnection extends boolean = false> {
*/
onMessage?: (message: StreamMessage<SingleConnection, StreamEvent>) => 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".
*
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ export function parseStreamData<ForID extends boolean, E extends StreamEvent>(
export interface Sink<T = unknown> {
/** 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
*/
Expand All @@ -162,7 +162,7 @@ export function isAsyncIterable<T>(val: unknown): val is AsyncIterable<T> {
}

/**
* Checkes whether the provided value is an async generator.
* Checks whether the provided value is an async generator.
*
* @category Common
*/
Expand Down
14 changes: 7 additions & 7 deletions src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -343,7 +343,7 @@ export type Handler<RequestRaw = unknown, RequestContext = unknown> = (
) => Promise<Response>;

/**
* 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.
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

enum ControlChars {
NewLine = 10,
CchunkiageReturn = 13,
CarriageReturn = 13,
Space = 32,
Colon = 58,
}
Expand Down Expand Up @@ -69,7 +69,7 @@ export function createParser<ForID extends boolean>(): (
}
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:
Expand Down
6 changes: 3 additions & 3 deletions tests/utils/testkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function sleep(ms: number) {
return new Promise<void>((resolve) => setTimeout(resolve, ms));
}

export type OnOpeartionArgs<
export type OnOperationArgs<
RequestRaw = unknown,
RequestContext = unknown,
Context extends OperationContext = undefined,
Expand All @@ -21,7 +21,7 @@ export interface TestKit<
Context extends OperationContext = undefined,
> {
waitForOperation(): Promise<
OnOpeartionArgs<RequestRaw, RequestContext, Context>
OnOperationArgs<RequestRaw, RequestContext, Context>
>;
}

Expand All @@ -33,7 +33,7 @@ export function injectTestKit<
opts: Partial<HandlerOptions<RequestRaw, RequestContext, Context>> = {},
): TestKit<RequestRaw, RequestContext, Context> {
const onOperation =
queue<OnOpeartionArgs<RequestRaw, RequestContext, Context>>();
queue<OnOperationArgs<RequestRaw, RequestContext, Context>>();
const origOnOperation = opts.onOperation;
opts.onOperation = async (...args) => {
onOperation.add(args);
Expand Down

0 comments on commit 98d5b7f

Please sign in to comment.