diff --git a/package.json b/package.json index a2c282cce..9aac3b215 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ ], "devDependencies": { "@sindresorhus/tsconfig": "~0.7.0", - "expect-type": "^0.14.2", + "expect-type": "^0.15.0", "tsd": "^0.24.1", - "typescript": "^4.8.3", - "xo": "^0.52.2" + "typescript": "^4.8.4", + "xo": "^0.52.4" }, "xo": { "rules": { diff --git a/readme.md b/readme.md index 2d2d814d0..e575a84b8 100644 --- a/readme.md +++ b/readme.md @@ -214,7 +214,7 @@ Click the type names for complete docs. - [`MultidimensionalArray`](source/multidimensional-array.d.ts) - Create a type that represents a multidimensional array of the given type and dimensions. - [`MultidimensionalReadonlyArray`](source/multidimensional-readonly-array.d.ts) - Create a type that represents a multidimensional readonly array of the given type and dimensions. - [`ReadonlyTuple`](source/readonly-tuple.d.ts) - Create a type that represents a read-only tuple of the given type and length. -- [`TupleToUnion`](source/tuple-to-union.d.ts) - Convert a tuple into a union type of its elements. +- [`TupleToUnion`](source/tuple-to-union.d.ts) - Convert a tuple/array into a union type of its elements. ### Numeric diff --git a/source/tuple-to-union.d.ts b/source/tuple-to-union.d.ts index 1db246fb1..b2bdf8965 100644 --- a/source/tuple-to-union.d.ts +++ b/source/tuple-to-union.d.ts @@ -1,5 +1,5 @@ /** -Convert a tuple into a union type of its elements. +Convert a tuple/array into a union type of its elements. This can be useful when you have a fixed set of allowed values and want a type defining only the allowed values, but do not want to repeat yourself.