mirror of
https://github.com/type-challenges/type-challenges.git
synced 2025-12-08 19:06:13 +00:00
Omit<T, K>

by Anthony Fu @antfu
Implement the built-in Omit<T, K> generic without using it.
Constructs a type by picking all properties from T and then removing K
For example
interface Todo {
title: string
description: string
completed: boolean
}
type TodoPreview = MyOmit<Todo, 'description' | 'title'>
const todo: TodoPreview = {
completed: false,
}