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

@ahrjarrett/v0.48.1 #171

Merged
merged 4 commits into from
Nov 16, 2024
Merged

@ahrjarrett/v0.48.1 #171

merged 4 commits into from
Nov 16, 2024

Conversation

ahrjarrett
Copy link
Owner

@ahrjarrett ahrjarrett commented Nov 16, 2024

Closes:

changelog

new features

inline is basically a type-level identity function.

like its runtime counterpart, it can be pretty useful.

the name inline refers to the particular use case that I usually use it for, which is for wrapping a type literal so that an interface can extend it.

import type { inline } from "any-ts"

//////////////
/// example

/** 
 * did you know you can make an interface out of an array?
 * this can be useful when you want to preserve the
 * identifier:             vvvv   */
interface Numbers extends inline<number[]> {}

declare const numbers: Numbers
//            ^? const numbers: Numbers

// normal array behavior is preserved:
const copy = [...ex_01.numbers]
//    ^? const copy: number[]

`inline` is basically a type-level identity function. like its runtime counterpart,
it ends up being useful in more places than you might expect.
Copy link

changeset-bot bot commented Nov 16, 2024

🦋 Changeset detected

Latest commit: 55769da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
any-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ahrjarrett ahrjarrett merged commit 7666a6d into main Nov 16, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant