Enhanced type system
npm install type-enhancers``shell`
npm i -d type-enhancers
To use utils, you have to import them in every file with named import from utils folder:
`typescript`
import type { Nilable, Nullable } from "type-enhancers/utils";
`typescript`
import type { Nilable } from "type-enhancers/utils/Nilable";
import type { Nullable } from "type-enhancers/utils/Nullable";
To use overloads, you have to import them in one file from overloads folder.
You can control the scope of overloads just from your import:
`typescript`
import "type-enhancers/overloads";
`typescript`
import "type-enhancers/overloads/String";
`typescript``
import "type-enhancers/overloads/String/Split";
+ Number
+ Constructor
+ Number()
+ new Number()
+ toString
+ String
+ Constructor
+ String()
+ split (Returns tuple instead of an array)
+ toLowerCase
+ toUpperCase
+ trim
+ trimEnd
+ trimStart
+ BigIntToNumber
+ BigIntToString
+ BooleanToString
+ Falsy
+ If
+ IfElse
+ IsAny
+ IsBigInt
+ IsBoolean
+ IsEmptyString
+ IsExtends
+ IsFalse
+ IsFalsy
+ IsNull
+ IsNullish
+ IsNumber
+ IsPrimitive
+ IsString
+ IsStringLikeNumber
+ IsSymbol
+ IsTrue
+ IsTruthy
+ IsUndefined
+ IsZero
+ Nilable
+ Not
+ Nullable
+ Nullish
+ NumberToString
+ Primitive
+ SplitByString
+ StrictOmit
+ StringToNumber
+ StringWithAutocompletion
+ Trim
+ TrimEnd
+ TrimStart
+ Undefinable
+ WhiteSpace
+ Zero