type alias U.Selectimport { type U } from "https://deno.land/x/ts_toolbelt_unofficial@1.1.0/mod.ts"; const { Select } = U; Extract the part of U that matches M ExamplesExample 1 Type ParametersU extends anyM extends anyoptionalmatch extends Match = "default"definition: U extends unknown ? { 1: U & M; 0: never; }[Is<U, M, match>] : never