typecheck.macro icon indicating copy to clipboard operation
typecheck.macro copied to clipboard

Support typeof tuple[number] pattern

Open cometkim opened this issue 3 years ago • 0 comments

// Use this to get an iterable of possible values.
const namingConvention = ['snake_case', 'camelCase'] as const;

type NamingConvention = typeof namingConvention[number];

registerType('NamingConvention');

export const isValidNamingConvention = createValidator<NamingConvention>();

got error:

Unexpected error because TSIndexedAccessType was not expected. Please report this to the developer.

cometkim avatar Apr 04 '21 04:04 cometkim