Skip to content

Commit

Permalink
improve typeCheck utility (#239890)
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom authored Feb 7, 2025
1 parent ea1cad7 commit 86bc5fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vs/base/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ export function assertOneOf<TType, TSubtype extends TType>(
}

/**
* Simple compile-time type check function to validate a type of
* a provided object.
* Compile-time type check of a variable.
*/
export function typeCheck<T extends unknown>(_thing: T): asserts _thing is T { }
export function typeCheck<T = never>(_thing: NoInfer<T>): void { }

const hasOwnProperty = Object.prototype.hasOwnProperty;

Expand Down

0 comments on commit 86bc5fa

Please sign in to comment.