Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Omit as a known interface #30455

Copy link
Copy link
@basarat

Description

@basarat
Issue body actions

Search Terms

Omit

Suggestion

Add the following type to lib.d.ts:

type Omit<ObjectType, KeysType extends keyof ObjectType> = Pick<ObjectType, Exclude<keyof ObjectType, KeysType>>;

More

Origin : #12215 (comment)

From : https://github.com/sindresorhus/type-fest/blob/0226ef2092ee2b07a8714c832d106da659877a8f/index.d.ts#L75 Please open new issues on TypeScript about making it built-in.. I searched but couldn't find an issue, so here it is 🌹

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
dragomirtitian, NN---, malimccalla, csantos42, CvX and 173 moreulrichb, markdalgleish, capaj, kossnocorp, wpq0 and 23 morekossnocorp, vkrol, styfle, jefrydco, pascaliske and 9 more

Metadata

Metadata

Labels

Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeCommittedThe team has roadmapped this issueThe team has roadmapped this issueFixedA PR has been merged for this issueA PR has been merged for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.