@13onthecode/types
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

@13OnTheCode/Types

TypeScript

Version License

English | 简体中文

A collection of TypeScript utility types

Prerequisites

TypeScript

  • Version >= 5.0.0

Install

npm install @13onthecode/types --save-dev

Usage

import type { MergeObject } from '@13onthecode/types'

type Foo = {
  foo: 'foo'
  other: {
    foo: 'foo'
  }
}

type Bar = {
  bar: 'bar'
  other: {
    bar: 'bar'
  }
}

type Merged = MergeObject<Foo, Bar>
// => {
//   foo: "foo"
//   bar: "bar"
//   other: {
//       bar: 'bar'
//   }
// }

type DeepMerged = MergeObject<Foo, Bar, { mode: 'deep' }>
// => {
//   foo: "foo"
//   bar: "bar"
//   other: {
//       foo: "foo"
//       bar: "bar"
//   }
// }

API

Array

Base

Guard

Map

Object

Set

String

Utils

Check Also

License

MIT License © 2023-PRESENT 13OnTheCode

Readme

Keywords

Package Sidebar

Install

npm i @13onthecode/types

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

31.8 kB

Total Files

7

Last publish

Collaborators

  • 13onthecode