devtypes - v1.1.0
    Preparing search index...

    Type Alias Exact<T, Shape>

    Exact: T extends Shape
        ? Exclude<keyof T, keyof Shape> extends never ? T : never
        : never

    Exact type matching: ensure no extra properties.

    Type Parameters

    • T

      The type to validate

    • Shape

      The exact shape to match

    Validates that T matches exactly the shape of Shape. Useful for type-level validation or enforcing strict interfaces.

    type A = Exact< { a: number }, { a: number } >;            // { a: number }
    type B = Exact< { a: number; b: number }, { a: number } >; // never