This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
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 personally 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[]
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
any-ts@0.48.1
Patch Changes
#171
47039da
Thanks @ahrjarrett! - feat: addsinline
type utilitynew 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 personally usually use it for, which is for wrapping a type literal so that an interface can extend it.