Skip to content

Support typeof tuple[number] pattern #20

@cometkim

Description

@cometkim
// 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions