type-enhancers
v0.9.2
Published
Enhanced type system
Downloads
775
Maintainers
Readme
type-enhancers
Installing
npm i -d type-enhancersHow to use
Utils
To use utils, you have to import them in every file with named import from utils folder:
Import from utils folder
import type { Nilable, Nullable } from "type-enhancers/utils";Import directly from utils files
import type { Nilable } from "type-enhancers/utils/Nilable";
import type { Nullable } from "type-enhancers/utils/Nullable";Overloads
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:
Import all overloads:
import "type-enhancers/overloads";Import all overloads for String:
import "type-enhancers/overloads/String";Import all overloads for the String split method:
import "type-enhancers/overloads/String/Split";Available overloads
Number
- Constructor
- toString
String
- Constructor
- split (Returns tuple instead of an array)
- toLowerCase
- toUpperCase
- trim
- trimEnd
- trimStart
Available utils
- 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
