GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add the Omit helper type by DanielRosenwasser · Pull Request #30552 · microsoft/TypeScript

Conversation

@DanielRosenwasser

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) commented Mar 22, 2019

Copy link
Copy Markdown
Member

Fixes #30455.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dragomirtitian, csantos42, vkrol, mmkal, arahansen, maxdeviant, Rudeg, jcalz, strothj, ulrichb, and 13 more reacted with thumbs up emoji dragomirtitian, csantos42, Pajn, AviVahl, vkrol, ljharb, jcalz, ffdanielfischer, styfle, SpencerPark, and 5 more reacted with hooray emoji leoyli, christophehurpeau, konsalex, and KazimirPodolski reacted with confused emoji houfio, styfle, weswigham, iRoachie, dekhanov, RyanCavanaugh, and konsalex reacted with heart emoji cheezenaan and AllenConway reacted with rocket emoji
All reactions
  • 👍 23 reactions
  • 🎉 15 reactions
  • 😕 4 reactions
  • ❤️ 7 reactions
  • 🚀 2 reactions
@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Mar 22, 2019

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) run dt

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 22, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the Definitely Typed test suite on this PR at 53e76b3. You can monitor the build here. It should now contribute to this PR's status checks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Mar 23, 2019

Copy link
Copy Markdown
Member Author

The only breakages on DefinitelyTyped seem to be

  • amap-js-api
  • amap-js-api-indoor-map
  • amap-js-api-map3d

And those all really come from amap-js-api unnecessarily plopping Omit in the global scope.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Apr 3, 2019
Move global declarations into a namespace for 'amap-js-api'. DefinitelyTyped/DefinitelyTyped#34454
Merged
@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Apr 3, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

A fix is now out to DefinitelyTyped's amap-js-api package.

I used BigTSQuery to partially assess the breakage with the following query

SourceFile:not([externalModuleIndicator]) > TypeAliasDeclaration > Identifier[name=Omit]

BigTSQuery isn't fully up to date (Uri Shaked (@urish) out of curiosity, how recent is the dataset?), but we saw three distinct results:

  • an old fork of hollowverse (M-Fawaz Orabi (@forabi))
  • an old revision of ArragroCMS.Examples (thanks Michael Jewell (@mike-jewell))
  • this one test case we have in our repository

Also:

  • There are no global InterfaceDeclarations named Omit
  • There are no global ClassDeclarations named Omit
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Apr 4, 2019

Copy link
Copy Markdown
Member Author

We discussed this at #30738 and believe that the breakage can be easily communicated and is more limited than we initially anticipated.

ljharb, csantos42, strothj, vkrol, and scotttrinh reacted with hooray emoji
All reactions
  • 🎉 5 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Daniel Rosenwasser (DanielRosenwasser) and others added 4 commits April 4, 2019 10:01
@DanielRosenwasser
Add the Omit helper type.
13d2b8d
@DanielRosenwasser
Fix tests to be non-global.
1dae8fc
@DanielRosenwasser
Accepted baselines.
e8feaf9
@DanielRosenwasser
Updated annoying 'globalTypes' list.
71af02f
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) force-pushed the omit branch from 67a9357 to 71af02f Compare April 4, 2019 17:17
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) merged commit 586ecbf into master Apr 4, 2019
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) deleted the omit branch April 4, 2019 17:37
@levenleven

Aleksey Levenstein (levenleven) commented Apr 7, 2019

Copy link
Copy Markdown

Keys are not limited to keyof T. Is that on purpose?

sindresorhus, leoyli, gkalpak, gins3000, Aksigera, liuxiaojiu, and Trojan0523 reacted with thumbs up emoji
All reactions
  • 👍 7 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vkrol

Veniamin Krol (vkrol) commented Apr 7, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Aleksey Levenstein (@levenleven)

Should we constrain K in the official definition?

Nah

#30738

🤔

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

Exclude doesn't constrain its second type parameter on the first, so we felt like it would be strange to do that with Omit.

luketanner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

Note, if you feel that shouldn't be the case, I'd encourage you to open up a separate issue to discuss it.

levenleven and dualscyther reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seansfkelley Sean Kelley (seansfkelley) mentioned this pull request Apr 9, 2019
add stricter Omit helper type #30825
Closed
5 tasks done
@urish

Uri Shaked (urish) commented Apr 13, 2019

Copy link
Copy Markdown

Daniel Rosenwasser (@DanielRosenwasser) the BigTSQuery dataset has last been updated around June 2018. If you find it useful, I can spend some time updating it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@felixfbecker

Felix Becker (felixfbecker) commented May 16, 2019

Copy link
Copy Markdown
Contributor

Can Omit please be made strict before 3.5 moves to stable? #30825

gkalpak reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh

Ryan Cavanaugh (RyanCavanaugh) commented May 17, 2019

Copy link
Copy Markdown
Member

Felix Becker (@felixfbecker) the definition was intentional.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@leoyli

Leo Y. Li (leoyli) commented May 19, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Daniel Rosenwasser (@DanielRosenwasser)

Exclude doesn't constrain its second type parameter on the first, so we felt like it would be strange to do that with Omit.

But how a bout the case of Pick? Pick do constrain the use case.

Pick: pick members from a group to get a sub-group;
Omit: omit members in a group to get a sub-group;

As you can see, these 2 helper types are somehow complimentary. Looks pretty nature and intuitive when we use them together. How come Omit being permissive and Pick isn't???

When we make comparison, compare Omit with Exclude is like compare egg with chicken. Exclude is comparable with Extract not Omit, which should be Pick, IMHO.

G-Rath, gkalpak, dualscyther, rafsawicki, WhiteAbeLincoln, FredrikAugust, OliverJAsh, levenleven, chunsch, patrickhulce, and 8 more reacted with thumbs up emoji moyashin63 reacted with rocket emoji
All reactions
  • 👍 18 reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@OliverJAsh

Oliver Joseph Ash (OliverJAsh) commented Jul 3, 2019

Copy link
Copy Markdown
Contributor

I've ran into a few bugs which would have been caught if K was constrained (like it is for Pick). Any chance of reconsidering this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brendankenny Brendan Kenny (brendankenny) mentioned this pull request Jul 12, 2019
deps: update to typescript 3.5.3 GoogleChrome/lighthouse#9357
Merged
@chocolateboy chocolateboy mentioned this pull request Jan 10, 2021
Duplication of types included in the standard library pelotom/type-zoo#41
Open
@KazimirPodolski

KazimirPodolski commented Oct 17, 2025

Copy link
Copy Markdown

TypeScript is not open-source, it's source-available.

RyanCavanaugh reacted with confused emoji
All reactions
  • 😕 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 17, 2025
@typescript-bot TypeScript Bot (typescript-bot) assigned Daniel Rosenwasser (DanielRosenwasser) Oct 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser)

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add Omit as a known interface

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@DanielRosenwasser @typescript-bot @levenleven @vkrol @urish @felixfbecker @RyanCavanaugh @leoyli @OliverJAsh @KazimirPodolski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.