Advanced types and utility functions for TypeScript.
$ npm install --save ts-advanced-types
See index.ts for full reference.
Without<T, U>
Remove all properties from T that are assignable to UTypeXOR<T, U>
XOR of two types
Falsy
JavaScript falsy typesPrimitiveValidIndexSignature
JavaScript primitive types accepted as index signaturesPrimitive
JavaScript primitive non-falsy typesComplex
JavaScript non-falsy typesFalsyOrLiteral
JavaScript primitive types, including falsy valuesDocument<T = Complex>
An object made of string keys and non-falsy values. To add new types to values, use theT
type parameter.JsonOrString
A JSON, as a string or as a parsed object or array
TreeItem<T>
A generic treeEmptyConstructorOf<T>
A type that implements a constructor without argumentsClonableType<T>
A type that is clonable: it can be instantiated with a partial object
isFalsyOrSpaces(value)
Check if a value is falsy or a string with only spaces, ignoring number 0withoutProps(obj, ...props)
Clones an object, optionally removing a list of propertiesequals(a, b)
Checks if two objects are equal using theequals
method or strict equalitygetMethods(obj)
List all methods of an object and its prototypes