devtypes - v2.0.0
    Preparing search index...

    Type Alias PartiallyMapped<Keys, T>

    PartiallyMapped: { [K in Keys]?: T }

    Constructs an object whose properties are optional and which keys are Keys and property values are T.

    Type Parameters

    • Keys extends string

      A string type, likely string template

    • T

      Any type that can fit into an object

    Complementary to Mapped.

    const stringValidator: PartiallyMapped< 'username' | 'email', ( field: string ) => boolean > = {
    username: ( field: string ) => regex.validate( 'username', field )
    };