Skip to content

Commit 76bd9cd

Browse files
committed
Fix typos
1 parent 59bd056 commit 76bd9cd

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Click the type names for complete docs.
282282
- [`NonNegativeInteger`](source/numeric.d.ts) - A non-negative (`0 <= x < ∞`) `number` that is an integer.
283283
- [`IsNegative`](source/numeric.d.ts) - Returns a boolean for whether the given number is a negative number.
284284
- [`IsFloat`](source/is-float.d.ts) - Returns a boolean for whether the given number is a float, like `1.5` or `-1.5`.
285-
- [`IsInteger`](source/is-integer.d.ts) - Returns a boolean for whether the given number is a integer, like `-5`, `1.0` or `100`.
285+
- [`IsInteger`](source/is-integer.d.ts) - Returns a boolean for whether the given number is an integer, like `-5`, `1.0` or `100`.
286286
- [`GreaterThan`](source/greater-than.d.ts) - Returns a boolean for whether a given number is greater than another number.
287287
- [`GreaterThanOrEqual`](source/greater-than-or-equal.d.ts) - Returns a boolean for whether a given number is greater than or equal to another number.
288288
- [`LessThan`](source/less-than.d.ts) - Returns a boolean for whether a given number is less than another number.

source/internal/tuple.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Union = TupleLength<[] | [1, 2, 3] | number[]>;
2323
*/
2424
export type TupleLength<T extends UnknownArray> =
2525
// `extends unknown` is used to convert `T` (if `T` is a union type) to
26-
// a [distributive conditionaltype](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types))
26+
// a [distributive conditional type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types))
2727
T extends unknown
2828
? number extends T['length']
2929
? never // Return never if the given type is an non-flexed-length array like `Array<string>`

source/set-parameter-type.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ type MergeObjectToArray<TArray extends UnknownArray, TObject, TArrayCopy extends
3838
: K extends keyof TObject ? TObject[K] : TArray[K]
3939
}
4040
: TObject extends object
41-
// If `TObject` is a object witch key is number like `{0: string, 1: number}`
41+
// If `TObject` is an object with number keys like `{0: string, 1: number}`
4242
? {
4343
[K in keyof TArray]:
4444
K extends `${infer NumberK extends number}`
4545
? NumberK extends keyof TObject ? TObject[NumberK] : TArray[K]
4646
: number extends K
4747
// If array key `K` is `number`, means it's a rest parameter, we should set the rest parameter type to corresponding type in `TObject`.
48-
// example: `MergeObjectToParamterArray<[string, ...boolean[]], {1: number}>` => `[string, ...number[]]`
48+
// example: `MergeObjectToArray<[string, ...boolean[]], {1: number}>` => `[string, ...number[]]`
4949
? StaticPartOfArray<TArrayCopy>['length'] extends keyof TObject
5050
? TObject[StaticPartOfArray<TArrayCopy>['length']]
5151
: TArray[K]

source/shared-union-fields-deep.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function displayPetInfoWithSharedUnionFieldsDeep(petInfo: SharedUnionFieldsDeep<
8989
export type SharedUnionFieldsDeep<Union, Options extends SharedUnionFieldsDeepOptions = {}> =
9090
ApplyDefaultOptions<SharedUnionFieldsDeepOptions, DefaultSharedUnionFieldsDeepOptions, Options> extends infer OptionsWithDefaults extends Required<SharedUnionFieldsDeepOptions>
9191
// `Union extends` will convert `Union`
92-
// to a [distributive conditionaltype](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
92+
// to a [distributive conditional type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
9393
// But this is not what we want, so we need to wrap `Union` with `[]` to prevent it.
9494
? [Union] extends [NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>]
9595
? Union

source/tagged.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const moneyByAccountType: Record<UnwrapTagged<AccountType>, number> = {
121121
// Without UnwrapTagged, the following expression would throw a type error.
122122
const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist
123123
124-
// Attempting to pass an non-Tagged type to UnwrapTagged will raise a type error.
124+
// Attempting to pass a non-Tagged type to UnwrapTagged will raise a type error.
125125
// @ts-expect-error
126126
type WontWork = UnwrapTagged<string>;
127127
```
@@ -239,7 +239,7 @@ const moneyByAccountType: Record<UnwrapOpaque<AccountType>, number> = {
239239
// Without UnwrapOpaque, the following expression would throw a type error.
240240
const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist
241241
242-
// Attempting to pass an non-Opaque type to UnwrapOpaque will raise a type error.
242+
// Attempting to pass a non-Opaque type to UnwrapOpaque will raise a type error.
243243
// @ts-expect-error
244244
type WontWork = UnwrapOpaque<string>;
245245

0 commit comments

Comments
 (0)