@13onthecode/types
v0.0.3
Published
A collection of TypeScript utility types
Downloads
7
Readme
@13OnTheCode/Types
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
EmptyArray
EmptyMap
EmptyObject
EmptyRecord
EmptySet
Primitive
TypedArray
UnknownArray
UnknownAsyncFunction
UnknownFunction
UnknownMap
UnknownObject
UnknownRecord
UnknownSet
UnknownTuple
Guard
IsAny
IsArray
IsAsyncFunction
IsBigint
IsBigintLiteral
IsBoolean
IsBooleanLiteral
IsEmptyArray
IsEmptyMap
IsEmptyObject
IsEmptyRecord
IsEmptySet
IsEmptyString
IsEqual
IsFalse
IsFunction
IsLiteral
IsMap
IsNever
IsNonNullable
IsNull
IsNullable
IsNumber
IsNumberLiteral
IsObject
IsPrimitive
IsSet
IsString
IsStringLiteral
IsSymbol
IsSymbolLiteral
IsTrue
IsTuple
IsType
IsUndefined
IsUnion
IsUnknown
Map
Object
Set
String
Utils
Entries
GetKeys
GetOptional
GetReadonly
GetRequired
GetValues
OmitIndexSignature
PickIndexSignature
Prettify
SetOptional
SetReadonly
SetRequired
ToArray
ToNumber
ToPrimitive
ToUnion
Writable
Check Also
License
MIT License © 2023-PRESENT 13OnTheCode