0.0.3 • Published 2 years ago
@13onthecode/types v0.0.3
@13OnTheCode/Types
English | 简体中文
A collection of TypeScript utility types
Prerequisites
TypeScript
- Version >= 5.0.0
Install
npm install @13onthecode/types --save-devUsage
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
EmptyArrayEmptyMapEmptyObjectEmptyRecordEmptySetPrimitiveTypedArrayUnknownArrayUnknownAsyncFunctionUnknownFunctionUnknownMapUnknownObjectUnknownRecordUnknownSetUnknownTuple
Guard
IsAnyIsArrayIsAsyncFunctionIsBigintIsBigintLiteralIsBooleanIsBooleanLiteralIsEmptyArrayIsEmptyMapIsEmptyObjectIsEmptyRecordIsEmptySetIsEmptyStringIsEqualIsFalseIsFunctionIsLiteralIsMapIsNeverIsNonNullableIsNullIsNullableIsNumberIsNumberLiteralIsObjectIsPrimitiveIsSetIsStringIsStringLiteralIsSymbolIsSymbolLiteralIsTrueIsTupleIsTypeIsUndefinedIsUnionIsUnknown
Map
Object
Set
String
Utils
EntriesGetKeysGetOptionalGetReadonlyGetRequiredGetValuesOmitIndexSignaturePickIndexSignaturePrettifySetOptionalSetReadonlySetRequiredToArrayToNumberToPrimitiveToUnionWritable
Check Also
License
MIT License © 2023-PRESENT 13OnTheCode