diff --git a/src/types/__tests__/values.spec-d.ts b/src/types/__tests__/values.spec-d.ts index a6d847bf..494c1866 100644 --- a/src/types/__tests__/values.spec-d.ts +++ b/src/types/__tests__/values.spec-d.ts @@ -7,6 +7,7 @@ import type Person from '#fixtures/interfaces/person' import type Vehicle from '#fixtures/types/vehicle' import type EmptyArray from '../empty-array' import type EmptyObject from '../empty-object' +import type EmptyString from '../empty-string' import type Fn from '../fn' import type Get from '../get' import type Nullable from '../nullable' @@ -14,6 +15,7 @@ import type OmitNative from '../omit-native' import type Opaque from '../opaque' import type { tag as opaque } from '../opaque' import type Partial from '../partial' +import type Split from '../split' import type Spread from '../spread' import type TestSubject from '../values' import type Writable from '../writable' @@ -125,13 +127,12 @@ describe('unit-d:types/Values', () => { describe('T extends string', () => { describe('IsLiteral extends true', () => { - it('should equal Get, symbol>, any>[]', () => { + it('should equal Split', () => { // Arrange type T = 'vin' - type Expect = Get, symbol>, any>[] // Expect - expectTypeOf>().toEqualTypeOf() + expectTypeOf>().toEqualTypeOf>() }) }) diff --git a/src/types/values.ts b/src/types/values.ts index e7b6e01d..7068fab0 100644 --- a/src/types/values.ts +++ b/src/types/values.ts @@ -8,6 +8,7 @@ import type Get from './get' import type IfNumeric from './if-numeric' import type IfSymbol from './if-symbol' import type IsAny from './is-any' +import type IsLiteral from './is-literal' import type IsNever from './is-never' import type IsTuple from './is-tuple' import type Spread from './spread' @@ -61,6 +62,8 @@ type Values = IsAny extends true ? EmptyArray : T extends readonly never[] ? EmptyArray + : IsLiteral extends true + ? TupleFromRecord<{ [K in keyof U as UnwrapNumeric]: U[K] }> : IsTuple extends true ? TupleFromRecord<{ [K in keyof U as UnwrapNumeric]: U[K]