@lowlighter/typing
v3.1.1
Published
Utility types.
Downloads
78
Readme
🧰 Utility types
📑 Examples
import type { Arg, Arrayable, Nullable, Promisable } from "./types.ts"
function foo(_: unknown, args: Arrayable<string>): Promisable<Nullable<string>> {
return Promise.resolve(null)
}
// Get the type of arguments[1] of `foo` function
type args = Arg<typeof foo, 1>
✨ Features
AsyncFunction
,GeneratorFunction
andAsyncGeneratorFunction
constructors.- Addtional useful type utilites.
📜 License
Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSE