Additional types and types adjusted utilities for TypeScript
MIT License
Bot releases are hidden (Show)
Published by unional over 1 year ago
stub()
Published by unional over 1 year ago
NoInfer<T>
and improve stub()
Published by unional over 1 year ago
StringSplit
StringIncludes
type.Equal<A, B>
to handle optional param.Published by unional over 1 year ago
Failed
and FailedT
error type.Brand
and Flavor
to handle all types.Branded
and Flavored
interface to improve their rendering in IDE.Published by unional over 1 year ago
bcc4b094: Adding a new set of types for type-level programming.
IsAnyOrNever
AnyType
, IsAny
, NotAnyType
, IsNotAny
NeverType
, IsNever
, NotNeverType
, IsNotNever
StrictBooleanType
, IsStrictBoolean
, NotStrictBooleanType
, IsNotStrictBoolean
BooleanType
, NotBooleanType
, IsNotBoolean
TrueType
, IsTrue
, NotTrueType
, IsNotTrue
FalseType
, IsFalse
, NotFalseType
, IsNotFalse
ObjectType
, IsObject
, NotObjectType
, IsNotObject
StrictFunctionType
, IsStrictFunction
, NotStrictFunctionType
, IsNotStrictFunction
FunctionType
, IsFunction
, NotFunctionType
, IsNotFunction
UndefinedType
, IsUndefined
, NotUndefinedType
, IsNotUndefined
NumberType
, IsNumber
, NotNumberType
, IsNotNumber
StrictNumberType
, IsStrictNumber
, NotStrictNumberType
, IsNotStrictNumber
StringType
, IsString
, NotStringType
, IsNotString
StrictStringType
, IsStrictString
, NotStrictStringType
, IsNotStrictString
SymbolType
, IsSymbol
, NotSymbolType
, IsNotSymbol
BigIntType
, IsBigInt
, NotBigIntType
, IsNotBigInt
StrictBigIntType
, IsStrictBigInt
, NotStrictBigIntType
, IsNotStrictBigInt
VoidType
, IsVoid
, NotVoidType
, IsNotVoid
UnknownType
, IsUnknown
, NotUnknownType
, IsNotUnknown
Positive
, IsPositive
, NotPositive
, IsNotPositive
Adding a new testType
for testing.
It provides better testing support compares to isType
and assertType
.
Improve:
Equal
: to support all known scenarios.Published by unional over 1 year ago
TupleType
Equal
handles tuplePublished by unional over 1 year ago
bc82e907: Fix number types to support never
correctly.
Add IsInteger
, Positive
.
NumberType
to handle any
and union.Published by unional over 1 year ago
b6403520: Add ArrayType<A>
569ff770: Export Concat
under ArrayPlus
.
15257ec3: Add ArrayPlus.IsIndexOutOfBound<A, N>
82bed0e2: Add ArrayPlus.IndexAt
.
Update At
to use IndexAt
to get consistent results.
015d046e: Fix IsAny
and add to AnyType
.
Now using the same mechanism from ts-essentials
.
3ff303ce: Add NumberType<T>
812949be: Default CreateTuple<_, T>
to unknown
.
With TypeScript 5.0, the tuple size limit is now 9999.
52d62003: Clean up type imports.
Use Awaited
instead of PromiseValue
.
Published by unional over 1 year ago
35b489de: Add the following:
isType.never
Numeric
Zero
Integer
Negative
NonNegative
NumberPlus.Numeric
NumberPlus.Zero
NumberPlus.Integer
NumberPlus.Negative
NumberPlus.NonNegative
At
ArrayPlus.At
ArrayPlus.Concat
module
field for webpack
4 compatibility.Published by unional almost 2 years ago
stub.build()
now supports an initializer function.Published by unional almost 2 years ago
inspect()
to console.dir()
Published by unional almost 2 years ago
extender
will now only execute once,Published by unional almost 2 years ago
0247123b: Add AwaitedProps<T, P>
This is useful when working with context()
where the props are Promise
context().extend()
to specify typePublished by unional almost 2 years ago
context()
to support extender
which only needs a partial of the current context.Published by unional almost 2 years ago
context()
builderPublished by unional almost 2 years ago
Then, Else
support to logical typesEqual<A,B>
compose()
Published by unional almost 2 years ago
Readonly<T>
Published by unional almost 2 years ago
inspect()
PromiseValue
. Use the built-in Awaited<T>
instead.Published by unional almost 2 years ago
d43213f: Deprecates isConstructor
.
It cannot reliably detect non-constructors as normal functions and transpiled arrow functions are both returned true.
Add isInstanceof()
to do instanceof
check against unknown
or union types of constructor and other types.
isType()
does not accept AnyConstructor
anymore. Use isInstanceof()
instead (breaking).
PromiseOrValue<T>
(440d172)