@lowlighter/typing

3.1.1 • Public • Published

🧰 Utility types

JSR JSR Score NPM Coverage

📑 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 and AsyncGeneratorFunction constructors.
  • Addtional useful type utilites.

📜 License

Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSE

Readme

Keywords

Package Sidebar

Install

npm i @lowlighter/typing

Weekly Downloads

57

Version

3.1.1

License

MIT

Unpacked Size

14.5 kB

Total Files

15

Last publish

Collaborators

  • lowlighter