Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(assert): accept abstract classes #5978

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

0f-0b
Copy link
Contributor

@0f-0b 0f-0b commented Sep 14, 2024

Makes this work:

import { assertInstanceOf } from "jsr:@std/assert/instance-of";

assertInstanceOf([].values(), Iterator);

@0f-0b 0f-0b requested a review from kt3k as a code owner September 14, 2024 13:40
Comment on lines 7 to +9
export type AnyConstructor = new (...args: any[]) => any;
/** Gets constructor type */
export type GetConstructorType<T extends AnyConstructor> = T extends // deno-lint-ignore no-explicit-any
new (...args: any) => infer C ? C
: never;
export type GetConstructorType<T extends AnyConstructor> = InstanceType<T>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These types are now unused and should probably be deprecated.

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.27%. Comparing base (05b6d7e) to head (a2145fe).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5978      +/-   ##
==========================================
- Coverage   96.29%   96.27%   -0.02%     
==========================================
  Files         493      493              
  Lines       39530    39528       -2     
  Branches     5833     5833              
==========================================
- Hits        38065    38057       -8     
- Misses       1423     1429       +6     
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice!

@kt3k kt3k merged commit fc06009 into denoland:main Sep 17, 2024
17 checks passed
@0f-0b 0f-0b deleted the abstract-class branch September 17, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants