mirror of
https://github.com/type-challenges/type-challenges.git
synced 2026-02-01 15:47:22 +00:00
Omit

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,
}