Skip to content

Latest commit

 

History

History
183 lines (148 loc) · 5.12 KB

README.CN.md

File metadata and controls

183 lines (148 loc) · 5.12 KB

@13OnTheCode/Types

TypeScript

Version License

English | 简体中文

TypeScript 实用工具类型

Prerequisites

TypeScript

  • 版本 >= 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