All essential TypeScript types in one place 🤙
Tuple
's type implementation to only use a tuple type (instead of a union of a tuple type and an
array type).__OPAQUE_TYPE__
in Opaque
that cannot be used outside of ts-essentialsNonEmptyObject<T>
to not allow primitivesValueOf
utility type to cover the edge casesReadonlyArrayOrSingle
which is a counterpart to ArrayOrSingle
with the array being readonlycreateFactoryWithConstraint
Tail
to use variadic tuple typeDeepReadonly
for a union with an array of itselfMarkRequired
, MarkOptional
, MarkReadonly
and MarkWritable
StrictExtract
usage for TypeScript@^4.6.0NonEmptyArray
which ensures an array to have at least one itemStrictExclude
, a stricter version of Exclude
MarkWritable
which unsets readonly for specified keysMarkReadonly
which sets readonly for specific keysDeepPartial
for normal arraysIsAny
which returns true if it's any
, otherwise falseArrayOrSingle
DeepPick
with the validation of the filterCamelCase
and DeepCamelCaseProperties
for converting it from other casesDeepOmit
and DeepPick
DeepOmit
by removing 4 intersections for objects and applying generic restriction for FilterPropertyKey
with KeyofBase
to tolerate keyofStringsOnly
option in TypeScriptOptionalKeys
and RequiredKeys
for union of objects