Closed renovate[bot] closed 1 month ago
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
New and removed dependencies detected. Learn more about Socket for GitHub โ๏ธ
Package | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|
npm/expect-type@1.0.0 | None | 0 |
109 kB | mmkale |
๐ฎ Removed packages: npm/expect-type@0.20.0
This PR contains the following updates:
0.20.0
->1.0.0
Release Notes
mmkal/expect-type (expect-type)
### [`v1.0.0`](https://redirect.github.com/mmkal/expect-type/releases/tag/v1.0.0) [Compare Source](https://redirect.github.com/mmkal/expect-type/compare/v0.20.0...v1.0.0) ### v1! ๐๐๐ [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/mmkal)](https://x.com/mmkalmmkal) After many years being commitment-phobic, expect-type is now in v1. This release does *not* add any user facing features on top of v0.20.0 or v1.0.0-rc.0. It's just "making it official". For anyone new to the project, or coming here from vitest or viteconf (๐ ), the usage docs from the readme are pasted below. For anyone on an old-ish v0 version, here are links to the non-trivial changes that have gone in since v0.15.0: - [v0.20.0](https://redirect.github.com/mmkal/expect-type/releases/tag/v0.20.0): Function overloads support (proper support, beyond the default typescript functionality which eliminates all but one overloads by default) - [v0.19.0](https://redirect.github.com/mmkal/expect-type/releases/tag/0.19.0): Beefed up JSDocs thanks to [@aryaemami59](https://redirect.github.com/aryaemami59) - [v0.18.0](https://redirect.github.com/mmkal/expect-type/releases/tag/0.18.0): `.pick` and `.omit` thanks to [@aryaemami59](https://redirect.github.com/aryaemami59) - [v0.17.0](https://redirect.github.com/mmkal/expect-type/releases/tag/v0.17.0): massively improved error messages, so (in most cases) when an assertion fails you can see *what's* wrong, not just that *something* is wrong - [v0.16.0](https://redirect.github.com/mmkal/expect-type/releases/tag/v0.16.0): default to internal typescript implementation of type-identicalness. Introduce the `.branded` helper for the old behaviour. Also support function `this` parameters - thank to [@trevorade](https://redirect.github.com/trevorade) and [@papb](https://redirect.github.com/papb) Full usage docs below, for newbies (head to the [readme](https://redirect.github.com/mmkal/expect-type/blob/main/README.md) to keep up to date):docs from readme
#### Installation and usage ```cli npm install expect-type --save-dev ``` ```typescript import {expectTypeOf} from 'expect-type' ``` #### Documentation The `expectTypeOf` method takes a single argument or a generic type parameter. Neither it nor the functions chained off its return value have any meaningful runtime behaviour. The assertions you write will be *compile-time* errors if they don't hold true. ##### Features Check an object's type with `.toEqualTypeOf`: ```typescript expectTypeOf({a: 1}).toEqualTypeOf<{a: number}>() ``` `.toEqualTypeOf` can check that two concrete objects have equivalent types (note: when these assertions *fail*, the error messages can be less informative vs the generic type argument syntax above - see [error messages docs](#error-messages)): ```typescript expectTypeOf({a: 1}).toEqualTypeOf({a: 1}) ``` `.toEqualTypeOf` succeeds for objects with different values, but the same type: ```typescript expectTypeOf({a: 1}).toEqualTypeOf({a: 2}) ``` `.toEqualTypeOf` fails on excess properties: ```typescript // @ts-expect-error expectTypeOf({a: 1, b: 1}).toEqualTypeOf<{a: number}>() ``` To allow for extra properties, use `.toMatchTypeOf`. This is roughly equivalent to an `extends` constraint in a function type argument.: ```typescript expectTypeOf({a: 1, b: 1}).toMatchTypeOf<{a: number}>() ``` `.toEqualTypeOf` and `.toMatchTypeOf` both fail on missing properties: ```typescript // @ts-expect-error expectTypeOf({a: 1}).toEqualTypeOf<{a: number; b: number}>() // @ts-expect-error expectTypeOf({a: 1}).toMatchTypeOf<{a: number; b: number}>() ``` Another example of the difference between `.toMatchTypeOf` and `.toEqualTypeOf`, using generics. `.toMatchTypeOf` can be used for "is-a" relationships: ```typescript type Fruit = {type: 'Fruit'; edible: boolean} type Apple = {type: 'Fruit'; name: 'Apple'; edible: true} expectTypeOfConfiguration
๐ Schedule: Branch creation - At any time (no schedule defined), Automerge - "before 4am on Monday" (UTC).
๐ฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.
โป Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
๐ Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.