Validates that an expression matches some type while keeping the inferred type. (TS 4.9+)
Syntax
value satisfies TypeExample
Enter values below to update the example in real time.
const→palette→red→green→satisfies→Record→string→const palette = {
red: [255, 0, 0],
green: "#00ff00",
} satisfies Record<string, string | number[]>;