diff --git a/README.md b/README.md index 1b9b1bc4..3aea1a54 100644 --- a/README.md +++ b/README.md @@ -31,115 +31,115 @@ And if you're using decorators, set this. ``` Requires TypesScript `v5.0`+ ## Documentation -Checkout the full [API reference](https://ashgw.github.io/ts-roids/) for all usage examples with details. +Checkout the full [API reference](https://ts-roids.ashgw.me/) for all usage examples with details. #### Types -- [`Abs`](https://ashgw.github.io/ts-roids/types/Abs.html) - Get the absolute value of a [``Numeric``](https://ashgw.github.io/ts-roids/types/Numeric.html). -- [`And`](https://ashgw.github.io/ts-roids/types/And.html) - Logical AND between two boolean types. -- [`ArrayFilter`](https://ashgw.github.io/ts-roids/types/ArrayFilter.html) - Filters elements from an array based on a given predicate type. -- [`ArrayIncludes`](https://ashgw.github.io/ts-roids/types/ArrayIncludes.html) - Checks if a given type is in an array. -- [`ArrayIntersection`](https://ashgw.github.io/ts-roids/types/ArrayIntersection.html) - Calculates the intersection of the types within an array ``Arr`` of tuple types. -- [`ArrayMax`](https://ashgw.github.io/ts-roids/types/ArrayMax.html) - Extracts the maximum [``Numeric``](https://ashgw.github.io/ts-roids/types/Numeric.html) (positive and negative) value in a given array. -- [`ArrayMin`](https://ashgw.github.io/ts-roids/types/ArrayMin.html) - Extracts the minimum [``Numeric``](https://ashgw.github.io/ts-roids/types/Numeric.html) (positive and negative) value in a given array. -- [`ArrayTranspose`](https://ashgw.github.io/ts-roids/types/ArrayTranspose.html) - Transposes a given 2xN array or matrix, flipping the matrix over its diagonal, switching its row and column indices. -- [`ArrayUnique`](https://ashgw.github.io/ts-roids/types/ArrayUnique.html) - Constructs a new array containing only unique elements from a given array type. -- [`Assign`](https://ashgw.github.io/ts-roids/types/Assign.html) - Copies all enumerable own properties from one target object to a source array of objects. -- [`DeepImmutable`](https://ashgw.github.io/ts-roids/types/DeepImmutable.html) - Recursively turns the proprties within a given object type ``T`` immutable, as in have all the properties with the `readonly` modifier. -- [`Deepmutable`](https://ashgw.github.io/ts-roids/types/DeepMutable.html) - Recursively mutates all the proprties within a given object type ``T``, as in have all the properties without the `readonly` modifier. -- [`DeepRequired`](https://ashgw.github.io/ts-roids/types/DeepRequired.html) - Recursively make all object properties required. -- [`DeepNotRequired`](https://ashgw.github.io/ts-roids/types/DeepNotRequired.html) - Recursively make all object properties not required. -- [`DeepOmit`](https://ashgw.github.io/ts-roids/types/DeepOmit.html) - Recursively omits specified nested properties from an object, based on a given predicate `P`. -- [`DeepPick`](https://ashgw.github.io/ts-roids/types/DeepPick.html) - Deeply pick properties from a nested object, based on a given predicate `P`. -- [`DeepToPrimitive`](https://ashgw.github.io/ts-roids/types/DeepToPrimitive.html) - Recursively transforms an object type T into a type where all properties are replaced with their corresponding primitive types. -- [`EitherOneOrMany`](https://ashgw.github.io/ts-roids/types/EitherOneOrMany.html) - Represents a type that can be either a single value of type ``T`` or an array of values of type ``T``. -- [`EmptyObject`](https://ashgw.github.io/ts-roids/types/EmptyObject.html) - Represents any non-nullish value, basically `{}`. -- [`EqualStrlen`](https://ashgw.github.io/ts-roids/types/EqualStrlen.html) - Check if two strings ``S1`` and ``S2`` have the same length. -- [`Nullable`](https://ashgw.github.io/ts-roids/types/Nullable.html) - Represents any non-nullish value, basically `{}`. -- [`Equals`](https://ashgw.github.io/ts-roids/types/Equals.html) - Checks if two types ``X`` and ``Y`` are exactly equal. -- [`EvenNumeric`](https://ashgw.github.io/ts-roids/types/EvenNumeric.html) - Represents an even [`Numeric`](https://ashgw.github.io/ts-roids/types/Numeric.html). -- [`ExcludeNull`](https://ashgw.github.io/ts-roids/types/ExcludeNull.html) - Excludes ``null`` from a type ``T``. -- [`ExcludeNullable`](https://ashgw.github.io/ts-roids/types/ExcludeNullable.html) - Excludes [`Nullable`](https://ashgw.github.io/ts-roids/types/Nullable.html) from a type ``T``. -- [`ExcludeUndefined`](https://ashgw.github.io/ts-roids/types/ExcludeUndefined.html) - Excludes `undefined` from a type ``T``. -- [`Extends`](https://ashgw.github.io/ts-roids/types/Extends.html) - Evaluates whether one type ``T`` is assignable to another type ``U``. -- [`Falsy`](https://ashgw.github.io/ts-roids/types/Falsy.html) - Represents a type that is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) JavaScript. -- [`FalsyProperties`](https://ashgw.github.io/ts-roids/types/FalsyProperties.html) - Extracts falsy properties from an object type ``T``. -- [`FilterBy`](https://ashgw.github.io/ts-roids/types/FilterBy.html) - Filters keys from the object type `Obj` based on a specified predicate ``P``. -- [`Flip`](https://ashgw.github.io/ts-roids/types/Flip.html) - Flips keys with values of an object type `Obj`. -- [`Float`](https://ashgw.github.io/ts-roids/types/Float.html) - Type representing a float. -- [`If`](https://ashgw.github.io/ts-roids/types/If.html) - If ``C`` evaluates ``true``, ``Do``, otherwise return ``Else``. -- [`IfEquals`](https://ashgw.github.io/ts-roids/types/IfEquals.html) - Checks if type ``T`` is equal to type ``P``. If ``T`` is equal to ``P``, the type resolves to ``Do``, otherwise ``Else``. -- [`IfExtends`](https://ashgw.github.io/ts-roids/types/IfExtends.html) - Checks if type ``T`` extends type ``P``. if it does, the type resolves to ``Do``, otherwise ``Else``. -- [`ImmutableKeys`](https://ashgw.github.io/ts-roids/types/ImmutableKeys.html) - Retrieves the keys that are immutable (``readonly``) from an object of type ``Obj``. -- [`Integer`](https://ashgw.github.io/ts-roids/types/Integer.html) - Represents an integer. -- [`IsArrayIncludesTypeof`](https://ashgw.github.io/ts-roids/types/IsArrayIncludesTypeof.html) - Checks if an array type `Arr` includes one or more of `T` type. -- [`IsBigInt`](https://ashgw.github.io/ts-roids/types/IsBigInt.html) - Checks if `T` is a ``bigint``. -- [`IsBoolean`](https://ashgw.github.io/ts-roids/types/IsBoolean.html) - Checks if `T` is a ``boolean``. -- [`IsDeepImmutable`](https://ashgw.github.io/ts-roids/types/IsDeepImmutable.html) - Checks if all the nested properties of a given object ``Obj`` are immutable. -- [`IsDeepMutable`](https://ashgw.github.io/ts-roids/types/IsDeepMutable.html) - Checks if all the nested properties of a given object ``Obj`` are mutable. -- [`IsDeepNotRequired`](https://ashgw.github.io/ts-roids/types/IsDeepNotRequired.html) - Checks if all the properties of a given object (nested) are not required, as in, all properties have the `?` modifier. -- [`IsDeepRequired`](https://ashgw.github.io/ts-roids/types/IsDeepRequired.html) - Checks if all the properties of a given object (nested) are required, as in, all properties do not have the `?` modifier. -- [`IsExactlyAny`](https://ashgw.github.io/ts-roids/types/IsExactlyAny.html) - Checks if a type `T` is exactly `any`. -- [`IsExactlyBigInt`](https://ashgw.github.io/ts-roids/types/IsExactlyBigInt.html) - Checks if a type `T` is exactly `bigint` not a subtype of it. -- [`IsExactlyNumber`](https://ashgw.github.io/ts-roids/types/IsExactlyNumber.html) - Checks if a type `T` is exactly ``number`` not a subtype of it. -- [`IsExactlyString`](https://ashgw.github.io/ts-roids/types/IsExactlyString.html) - Checks if a type `T` is exactly ``string`` not a subtype of it. -- [`IsExactlySymbol`](https://ashgw.github.io/ts-roids/types/IsExactlySymbol.html) - Checks if a type `T` is exactly ``symbol`` not a subtype of it. -- [`IsExactlyUnknown`](https://ashgw.github.io/ts-roids/types/IsExactlyUnknown.html) - Checks if a type `T` is exactly ``unknown`` not a subtype of it. -- [`IsFalsy`](https://ashgw.github.io/ts-roids/types/IsFalsy.html) - Checks if a given type ``T`` is [``Falsy``](https://ashgw.github.io/ts-roids/types/Falsy.html). -- [`IsFloat`](https://ashgw.github.io/ts-roids/types/IsFloat.html) - Checks if a given type ``T`` is a [``Float``](https://ashgw.github.io/ts-roids/types/Float.html). -- [`IsFunction`](https://ashgw.github.io/ts-roids/types/IsFunction.html) - Checks if a given type ``T`` is a function. -- [`IsInteger`](https://ashgw.github.io/ts-roids/types/IsInteger.html) - Checks if a given [``Numeric``](https://ashgw.github.io/ts-roids/types/Numeric.html) is an [``Integer``](https://ashgw.github.io/ts-roids/types/Integer.html). -- [`IsNever:`](https://ashgw.github.io/ts-roids/types/IsNever.html) - Checks if a type `T` does not resolve, so `never`. -- [`IsNewable`](https://ashgw.github.io/ts-roids/types/IsNewable.html) - Checks if a type `T` is [``Newable``](https://ashgw.github.io/ts-roids/types/Newable.html). -- [`IsNullable`](https://ashgw.github.io/ts-roids/types/IsNullable.html) - Checks if a type `T` is [``Nullable``](https://ashgw.github.io/ts-roids/types/Nullable.html). -- [`IsNumber`](https://ashgw.github.io/ts-roids/types/IsNumber.html) - Checks if a type `T` is a `number`. -- [`IsNumeric`](https://ashgw.github.io/ts-roids/types/IsNumeric.html) - Checks if a type `T` is [``Numeric``](https://ashgw.github.io/ts-roids/types/Numeric.html). -- [`IsObject`](https://ashgw.github.io/ts-roids/types/IsObject.html) - Checks if a given type `T` qualifies as an object. -- [`IsString`](https://ashgw.github.io/ts-roids/types/IsString.html) - Check if a given type `T` is a ``string``. -- [`IsSymbol`](https://ashgw.github.io/ts-roids/types/IsSymbol.html) - Check if a given type `T` is a ``symbol``. -- [`IsTruthy`](https://ashgw.github.io/ts-roids/types/IsTruthy.html) - Check if a given type `T` resolves to a truthy value. -- [`Keys`](https://ashgw.github.io/ts-roids/types/Keys.html) - Retrieves the union type of keys (property names) of a type ``T``. -- [`Maybe`](https://ashgw.github.io/ts-roids/types/Maybe.html) - Type that might be [``Nullable``](https://ashgw.github.io/ts-roids/types/Nullable.html) -- [`MaybeUndefined`](https://ashgw.github.io/ts-roids/types/MaybeUndefined.html) - Type that might ``undefined``. -- [`MutableKeys`](https://ashgw.github.io/ts-roids/types/MutableKeys.html) - Retrieves the keys that are mutable from an object of type ``Obj``. -- [`Nand`](https://ashgw.github.io/ts-roids/types/Nand.html) - Logical ``NAND`` between two boolean types ``B1`` and ``B2``. -- [`NegativeFloat`](https://ashgw.github.io/ts-roids/types/NegativeFloat.html) - Represents a negative (\]-∞, 0\[) [``Float``](https://ashgw.github.io/ts-roids/types/Float.html). -- [`NegativeFloatString`](https://ashgw.github.io/ts-roids/types/NegativeFloatString.html) - Represents a negative [``Float``](https://ashgw.github.io/ts-roids/types/Float.html) parsed from a ``string``. -- [`NegativeInteger`](https://ashgw.github.io/ts-roids/types/NegativeInteger.html) - Represents a negative (\]-∞, 0\[) [``Integer``](https://ashgw.github.io/ts-roids/types/Integer.html). -- [`NegativeIntegerString`](https://ashgw.github.io/ts-roids/types/NegativeIntegerString.html) - Represents a negative [``Integer``](https://ashgw.github.io/ts-roids/types/Integer.html) parsed from a ``string``. -- [`NewType`](https://ashgw.github.io/ts-roids/types/NewType.html) - Represents a new unique type derived from an existing base type. (branded type) -- [`Newable`](https://ashgw.github.io/ts-roids/types/Newable.html) - Represents constructor functions that can be invoked using the new keyword. -- [`NonRequiredKeys`](https://ashgw.github.io/ts-roids/types/NonRequiredKeys.html) - Returns all non required keys of an object `Obj`, as in any property of an object that is marked with `?` operator. -- [`Not`](https://ashgw.github.io/ts-roids/types/Not.html) - Negates a boolean type `B`. -- [`Nullable`](https://ashgw.github.io/ts-roids/types/Nullable.html) - Represents a type that can either be ``null`` or ``undefined``. -- [`Numeric`](https://ashgw.github.io/ts-roids/types/Numeric.html) - Represents a type that can either be ``number`` or ``bigint``. -- [`NumerifyString`](https://ashgw.github.io/ts-roids/types/NumerifyString.html) - Turn a given string literal to a [``Numeric``](https://ashgw.github.io/ts-roids/types/Numeric.html), if possible. -- [`Methods`](https://ashgw.github.io/ts-roids/types/Methods.html) - Get the literal names of keys that are methods in an object type `Obj`. -- [`Properties`](https://ashgw.github.io/ts-roids/types/Properties.html) - Get the literal names of keys that are properties in an object type `Obj`. -- [`OddNumeric`](https://ashgw.github.io/ts-roids/types/OmitByType.html) - Represents an odd [`Numeric`](https://ashgw.github.io/ts-roids/types/OddNumeric.html). -- [`OmitByType`](https://ashgw.github.io/ts-roids/types/OmitByType.html) - Get a set of properties from `Obj` whose type are not assignable to ``T``. -- [`OmitCommonKeys`](https://ashgw.github.io/ts-roids/types/OmitCommonKeys.html) - Omit any common key between the the two objects,. -- [`OmitExactlyByType`](https://ashgw.github.io/ts-roids/types/OmitExactlyByType.html) - Omit properties from ``Obj`` whose type exactly matches ``T``. -- [`Optional`](https://ashgw.github.io/ts-roids/types/Optional.html) - Represents a type that may be `null`, similar to Python's ``Optional`` type and Rust's ``Option`` enum. -- [`Or`](https://ashgw.github.io/ts-roids/types/Or.html) - Logical ``OR`` between two boolean types ``B1`` and ``B2``. -- [`PickByType`](https://ashgw.github.io/ts-roids/types/PickByType.html) - Pick from `Obj` a set of properties that match the type `T`. -- [`PickCommonKeys`](https://ashgw.github.io/ts-roids/types/PickCommonKeys.html) - Get the common keys between two objects. -- [`PickExactlyByType`](https://ashgw.github.io/ts-roids/types/PickExactlyByType.html) - Get a set of properties from ``Obj`` whose type exactly matches ``T``. -- [`PositiveFloat`](https://ashgw.github.io/ts-roids/types/PositiveFloat.html) - Represents a positive (\[0, +∞\[) [``Float``](https://ashgw.github.io/ts-roids/types/Float.html). -- [`PositiveFloatString`](https://ashgw.github.io/ts-roids/types/PositiveFloatString.html) - Represents a positive [``Float``](https://ashgw.github.io/ts-roids/types/Float.html) parsed from a ``string``. -- [`PositiveInteger`](https://ashgw.github.io/ts-roids/types/PositiveInteger.html) - Represents a positive (\[0, +∞\[) [``Integer``](https://ashgw.github.io/ts-roids/types/Integer.html). -- [`PositiveIntegerString`](https://ashgw.github.io/ts-roids/types/PositiveIntegerString.html) - Represents a negative [``Integer``](https://ashgw.github.io/ts-roids/types/Integer.html) parsed from a ``string``. -- [`Primitive`](https://ashgw.github.io/ts-roids/types/Primitive.html) - All [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) types. -- [`ReplaceKeys`](https://ashgw.github.io/ts-roids/types/ReplaceKeys.html) - Constructs a new type by replacing properties `P` of type ``Obj`` with object type ``Obj2``. -- [`RequiredKeys`](https://ashgw.github.io/ts-roids/types/RequiredKeys.html) - Get the required keys of an object (shallow). -- [`StringEndsWith`](https://ashgw.github.io/ts-roids/types/StringEndsWith.html) - Checks if a string `S` ends with `E` -- [`StringStartsWith`](https://ashgw.github.io/ts-roids/types/StringStartsWith.html) - Checks if a string `S` starts with `St` -- [`StringifyPrimitive

`](https://ashgw.github.io/ts-roids/types/StringifyPrimitive.html) - Turns a given [``Primitive``](https://ashgw.github.io/ts-roids/types/Primitive.html) value (except ``symbol``) into its string representation. -- [`Strlen`](https://ashgw.github.io/ts-roids/types/Strlen.html) - Get the length of a string `S`. -- [`TestType`](https://ashgw.github.io/ts-roids/types/TestType.html) - Tests if type `T1` and `T2` are the same. -- [`TruthyProperties`](https://ashgw.github.io/ts-roids/types/TruthyProperties.html) - Extracts truthy properties from an object type ``T``. -- [`UnionToIntersection`](https://ashgw.github.io/ts-roids/types/UnionToIntersection.html) - As the name implies, it turns a union into an intersection. -- [`Vals`](https://ashgw.github.io/ts-roids/types/Vals.html) - Get the set of type values in a given object. -- [`Xor`](https://ashgw.github.io/ts-roids/types/Xor.html) - Exclusive ``OR`` between two boolean types ``B1`` and ``B2``. +- [`Abs`](https://ts-roids.ashgw.me/types/Abs.html) - Get the absolute value of a [``Numeric``](https://ts-roids.ashgw.me/types/Numeric.html). +- [`And`](https://ts-roids.ashgw.me/types/And.html) - Logical AND between two boolean types. +- [`ArrayFilter`](https://ts-roids.ashgw.me/types/ArrayFilter.html) - Filters elements from an array based on a given predicate type. +- [`ArrayIncludes`](https://ts-roids.ashgw.me/types/ArrayIncludes.html) - Checks if a given type is in an array. +- [`ArrayIntersection`](https://ts-roids.ashgw.me/types/ArrayIntersection.html) - Calculates the intersection of the types within an array ``Arr`` of tuple types. +- [`ArrayMax`](https://ts-roids.ashgw.me/types/ArrayMax.html) - Extracts the maximum [``Numeric``](https://ts-roids.ashgw.me/types/Numeric.html) (positive and negative) value in a given array. +- [`ArrayMin`](https://ts-roids.ashgw.me/types/ArrayMin.html) - Extracts the minimum [``Numeric``](https://ts-roids.ashgw.me/types/Numeric.html) (positive and negative) value in a given array. +- [`ArrayTranspose`](https://ts-roids.ashgw.me/types/ArrayTranspose.html) - Transposes a given 2xN array or matrix, flipping the matrix over its diagonal, switching its row and column indices. +- [`ArrayUnique`](https://ts-roids.ashgw.me/types/ArrayUnique.html) - Constructs a new array containing only unique elements from a given array type. +- [`Assign`](https://ts-roids.ashgw.me/types/Assign.html) - Copies all enumerable own properties from one target object to a source array of objects. +- [`DeepImmutable`](https://ts-roids.ashgw.me/types/DeepImmutable.html) - Recursively turns the proprties within a given object type ``T`` immutable, as in have all the properties with the `readonly` modifier. +- [`Deepmutable`](https://ts-roids.ashgw.me/types/DeepMutable.html) - Recursively mutates all the proprties within a given object type ``T``, as in have all the properties without the `readonly` modifier. +- [`DeepRequired`](https://ts-roids.ashgw.me/types/DeepRequired.html) - Recursively make all object properties required. +- [`DeepNotRequired`](https://ts-roids.ashgw.me/types/DeepNotRequired.html) - Recursively make all object properties not required. +- [`DeepOmit`](https://ts-roids.ashgw.me/types/DeepOmit.html) - Recursively omits specified nested properties from an object, based on a given predicate `P`. +- [`DeepPick`](https://ts-roids.ashgw.me/types/DeepPick.html) - Deeply pick properties from a nested object, based on a given predicate `P`. +- [`DeepToPrimitive`](https://ts-roids.ashgw.me/types/DeepToPrimitive.html) - Recursively transforms an object type T into a type where all properties are replaced with their corresponding primitive types. +- [`EitherOneOrMany`](https://ts-roids.ashgw.me/types/EitherOneOrMany.html) - Represents a type that can be either a single value of type ``T`` or an array of values of type ``T``. +- [`EmptyObject`](https://ts-roids.ashgw.me/types/EmptyObject.html) - Represents any non-nullish value, basically `{}`. +- [`EqualStrlen`](https://ts-roids.ashgw.me/types/EqualStrlen.html) - Check if two strings ``S1`` and ``S2`` have the same length. +- [`Nullable`](https://ts-roids.ashgw.me/types/Nullable.html) - Represents any non-nullish value, basically `{}`. +- [`Equals`](https://ts-roids.ashgw.me/types/Equals.html) - Checks if two types ``X`` and ``Y`` are exactly equal. +- [`EvenNumeric`](https://ts-roids.ashgw.me/types/EvenNumeric.html) - Represents an even [`Numeric`](https://ts-roids.ashgw.me/types/Numeric.html). +- [`ExcludeNull`](https://ts-roids.ashgw.me/types/ExcludeNull.html) - Excludes ``null`` from a type ``T``. +- [`ExcludeNullable`](https://ts-roids.ashgw.me/types/ExcludeNullable.html) - Excludes [`Nullable`](https://ts-roids.ashgw.me/types/Nullable.html) from a type ``T``. +- [`ExcludeUndefined`](https://ts-roids.ashgw.me/types/ExcludeUndefined.html) - Excludes `undefined` from a type ``T``. +- [`Extends`](https://ts-roids.ashgw.me/types/Extends.html) - Evaluates whether one type ``T`` is assignable to another type ``U``. +- [`Falsy`](https://ts-roids.ashgw.me/types/Falsy.html) - Represents a type that is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) JavaScript. +- [`FalsyProperties`](https://ts-roids.ashgw.me/types/FalsyProperties.html) - Extracts falsy properties from an object type ``T``. +- [`FilterBy`](https://ts-roids.ashgw.me/types/FilterBy.html) - Filters keys from the object type `Obj` based on a specified predicate ``P``. +- [`Flip`](https://ts-roids.ashgw.me/types/Flip.html) - Flips keys with values of an object type `Obj`. +- [`Float`](https://ts-roids.ashgw.me/types/Float.html) - Type representing a float. +- [`If`](https://ts-roids.ashgw.me/types/If.html) - If ``C`` evaluates ``true``, ``Do``, otherwise return ``Else``. +- [`IfEquals`](https://ts-roids.ashgw.me/types/IfEquals.html) - Checks if type ``T`` is equal to type ``P``. If ``T`` is equal to ``P``, the type resolves to ``Do``, otherwise ``Else``. +- [`IfExtends`](https://ts-roids.ashgw.me/types/IfExtends.html) - Checks if type ``T`` extends type ``P``. if it does, the type resolves to ``Do``, otherwise ``Else``. +- [`ImmutableKeys`](https://ts-roids.ashgw.me/types/ImmutableKeys.html) - Retrieves the keys that are immutable (``readonly``) from an object of type ``Obj``. +- [`Integer`](https://ts-roids.ashgw.me/types/Integer.html) - Represents an integer. +- [`IsArrayIncludesTypeof`](https://ts-roids.ashgw.me/types/IsArrayIncludesTypeof.html) - Checks if an array type `Arr` includes one or more of `T` type. +- [`IsBigInt`](https://ts-roids.ashgw.me/types/IsBigInt.html) - Checks if `T` is a ``bigint``. +- [`IsBoolean`](https://ts-roids.ashgw.me/types/IsBoolean.html) - Checks if `T` is a ``boolean``. +- [`IsDeepImmutable`](https://ts-roids.ashgw.me/types/IsDeepImmutable.html) - Checks if all the nested properties of a given object ``Obj`` are immutable. +- [`IsDeepMutable`](https://ts-roids.ashgw.me/types/IsDeepMutable.html) - Checks if all the nested properties of a given object ``Obj`` are mutable. +- [`IsDeepNotRequired`](https://ts-roids.ashgw.me/types/IsDeepNotRequired.html) - Checks if all the properties of a given object (nested) are not required, as in, all properties have the `?` modifier. +- [`IsDeepRequired`](https://ts-roids.ashgw.me/types/IsDeepRequired.html) - Checks if all the properties of a given object (nested) are required, as in, all properties do not have the `?` modifier. +- [`IsExactlyAny`](https://ts-roids.ashgw.me/types/IsExactlyAny.html) - Checks if a type `T` is exactly `any`. +- [`IsExactlyBigInt`](https://ts-roids.ashgw.me/types/IsExactlyBigInt.html) - Checks if a type `T` is exactly `bigint` not a subtype of it. +- [`IsExactlyNumber`](https://ts-roids.ashgw.me/types/IsExactlyNumber.html) - Checks if a type `T` is exactly ``number`` not a subtype of it. +- [`IsExactlyString`](https://ts-roids.ashgw.me/types/IsExactlyString.html) - Checks if a type `T` is exactly ``string`` not a subtype of it. +- [`IsExactlySymbol`](https://ts-roids.ashgw.me/types/IsExactlySymbol.html) - Checks if a type `T` is exactly ``symbol`` not a subtype of it. +- [`IsExactlyUnknown`](https://ts-roids.ashgw.me/types/IsExactlyUnknown.html) - Checks if a type `T` is exactly ``unknown`` not a subtype of it. +- [`IsFalsy`](https://ts-roids.ashgw.me/types/IsFalsy.html) - Checks if a given type ``T`` is [``Falsy``](https://ts-roids.ashgw.me/types/Falsy.html). +- [`IsFloat`](https://ts-roids.ashgw.me/types/IsFloat.html) - Checks if a given type ``T`` is a [``Float``](https://ts-roids.ashgw.me/types/Float.html). +- [`IsFunction`](https://ts-roids.ashgw.me/types/IsFunction.html) - Checks if a given type ``T`` is a function. +- [`IsInteger`](https://ts-roids.ashgw.me/types/IsInteger.html) - Checks if a given [``Numeric``](https://ts-roids.ashgw.me/types/Numeric.html) is an [``Integer``](https://ts-roids.ashgw.me/types/Integer.html). +- [`IsNever:`](https://ts-roids.ashgw.me/types/IsNever.html) - Checks if a type `T` does not resolve, so `never`. +- [`IsNewable`](https://ts-roids.ashgw.me/types/IsNewable.html) - Checks if a type `T` is [``Newable``](https://ts-roids.ashgw.me/types/Newable.html). +- [`IsNullable`](https://ts-roids.ashgw.me/types/IsNullable.html) - Checks if a type `T` is [``Nullable``](https://ts-roids.ashgw.me/types/Nullable.html). +- [`IsNumber`](https://ts-roids.ashgw.me/types/IsNumber.html) - Checks if a type `T` is a `number`. +- [`IsNumeric`](https://ts-roids.ashgw.me/types/IsNumeric.html) - Checks if a type `T` is [``Numeric``](https://ts-roids.ashgw.me/types/Numeric.html). +- [`IsObject`](https://ts-roids.ashgw.me/types/IsObject.html) - Checks if a given type `T` qualifies as an object. +- [`IsString`](https://ts-roids.ashgw.me/types/IsString.html) - Check if a given type `T` is a ``string``. +- [`IsSymbol`](https://ts-roids.ashgw.me/types/IsSymbol.html) - Check if a given type `T` is a ``symbol``. +- [`IsTruthy`](https://ts-roids.ashgw.me/types/IsTruthy.html) - Check if a given type `T` resolves to a truthy value. +- [`Keys`](https://ts-roids.ashgw.me/types/Keys.html) - Retrieves the union type of keys (property names) of a type ``T``. +- [`Maybe`](https://ts-roids.ashgw.me/types/Maybe.html) - Type that might be [``Nullable``](https://ts-roids.ashgw.me/types/Nullable.html) +- [`MaybeUndefined`](https://ts-roids.ashgw.me/types/MaybeUndefined.html) - Type that might ``undefined``. +- [`MutableKeys`](https://ts-roids.ashgw.me/types/MutableKeys.html) - Retrieves the keys that are mutable from an object of type ``Obj``. +- [`Nand`](https://ts-roids.ashgw.me/types/Nand.html) - Logical ``NAND`` between two boolean types ``B1`` and ``B2``. +- [`NegativeFloat`](https://ts-roids.ashgw.me/types/NegativeFloat.html) - Represents a negative (\]-∞, 0\[) [``Float``](https://ts-roids.ashgw.me/types/Float.html). +- [`NegativeFloatString`](https://ts-roids.ashgw.me/types/NegativeFloatString.html) - Represents a negative [``Float``](https://ts-roids.ashgw.me/types/Float.html) parsed from a ``string``. +- [`NegativeInteger`](https://ts-roids.ashgw.me/types/NegativeInteger.html) - Represents a negative (\]-∞, 0\[) [``Integer``](https://ts-roids.ashgw.me/types/Integer.html). +- [`NegativeIntegerString`](https://ts-roids.ashgw.me/types/NegativeIntegerString.html) - Represents a negative [``Integer``](https://ts-roids.ashgw.me/types/Integer.html) parsed from a ``string``. +- [`NewType`](https://ts-roids.ashgw.me/types/NewType.html) - Represents a new unique type derived from an existing base type. (branded type) +- [`Newable`](https://ts-roids.ashgw.me/types/Newable.html) - Represents constructor functions that can be invoked using the new keyword. +- [`NonRequiredKeys`](https://ts-roids.ashgw.me/types/NonRequiredKeys.html) - Returns all non required keys of an object `Obj`, as in any property of an object that is marked with `?` operator. +- [`Not`](https://ts-roids.ashgw.me/types/Not.html) - Negates a boolean type `B`. +- [`Nullable`](https://ts-roids.ashgw.me/types/Nullable.html) - Represents a type that can either be ``null`` or ``undefined``. +- [`Numeric`](https://ts-roids.ashgw.me/types/Numeric.html) - Represents a type that can either be ``number`` or ``bigint``. +- [`NumerifyString`](https://ts-roids.ashgw.me/types/NumerifyString.html) - Turn a given string literal to a [``Numeric``](https://ts-roids.ashgw.me/types/Numeric.html), if possible. +- [`Methods`](https://ts-roids.ashgw.me/types/Methods.html) - Get the literal names of keys that are methods in an object type `Obj`. +- [`Properties`](https://ts-roids.ashgw.me/types/Properties.html) - Get the literal names of keys that are properties in an object type `Obj`. +- [`OddNumeric`](https://ts-roids.ashgw.me/types/OmitByType.html) - Represents an odd [`Numeric`](https://ts-roids.ashgw.me/types/OddNumeric.html). +- [`OmitByType`](https://ts-roids.ashgw.me/types/OmitByType.html) - Get a set of properties from `Obj` whose type are not assignable to ``T``. +- [`OmitCommonKeys`](https://ts-roids.ashgw.me/types/OmitCommonKeys.html) - Omit any common key between the the two objects,. +- [`OmitExactlyByType`](https://ts-roids.ashgw.me/types/OmitExactlyByType.html) - Omit properties from ``Obj`` whose type exactly matches ``T``. +- [`Optional`](https://ts-roids.ashgw.me/types/Optional.html) - Represents a type that may be `null`, similar to Python's ``Optional`` type and Rust's ``Option`` enum. +- [`Or`](https://ts-roids.ashgw.me/types/Or.html) - Logical ``OR`` between two boolean types ``B1`` and ``B2``. +- [`PickByType`](https://ts-roids.ashgw.me/types/PickByType.html) - Pick from `Obj` a set of properties that match the type `T`. +- [`PickCommonKeys`](https://ts-roids.ashgw.me/types/PickCommonKeys.html) - Get the common keys between two objects. +- [`PickExactlyByType`](https://ts-roids.ashgw.me/types/PickExactlyByType.html) - Get a set of properties from ``Obj`` whose type exactly matches ``T``. +- [`PositiveFloat`](https://ts-roids.ashgw.me/types/PositiveFloat.html) - Represents a positive (\[0, +∞\[) [``Float``](https://ts-roids.ashgw.me/types/Float.html). +- [`PositiveFloatString`](https://ts-roids.ashgw.me/types/PositiveFloatString.html) - Represents a positive [``Float``](https://ts-roids.ashgw.me/types/Float.html) parsed from a ``string``. +- [`PositiveInteger`](https://ts-roids.ashgw.me/types/PositiveInteger.html) - Represents a positive (\[0, +∞\[) [``Integer``](https://ts-roids.ashgw.me/types/Integer.html). +- [`PositiveIntegerString`](https://ts-roids.ashgw.me/types/PositiveIntegerString.html) - Represents a negative [``Integer``](https://ts-roids.ashgw.me/types/Integer.html) parsed from a ``string``. +- [`Primitive`](https://ts-roids.ashgw.me/types/Primitive.html) - All [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) types. +- [`ReplaceKeys`](https://ts-roids.ashgw.me/types/ReplaceKeys.html) - Constructs a new type by replacing properties `P` of type ``Obj`` with object type ``Obj2``. +- [`RequiredKeys`](https://ts-roids.ashgw.me/types/RequiredKeys.html) - Get the required keys of an object (shallow). +- [`StringEndsWith`](https://ts-roids.ashgw.me/types/StringEndsWith.html) - Checks if a string `S` ends with `E` +- [`StringStartsWith`](https://ts-roids.ashgw.me/types/StringStartsWith.html) - Checks if a string `S` starts with `St` +- [`StringifyPrimitive

`](https://ts-roids.ashgw.me/types/StringifyPrimitive.html) - Turns a given [``Primitive``](https://ts-roids.ashgw.me/types/Primitive.html) value (except ``symbol``) into its string representation. +- [`Strlen`](https://ts-roids.ashgw.me/types/Strlen.html) - Get the length of a string `S`. +- [`TestType`](https://ts-roids.ashgw.me/types/TestType.html) - Tests if type `T1` and `T2` are the same. +- [`TruthyProperties`](https://ts-roids.ashgw.me/types/TruthyProperties.html) - Extracts truthy properties from an object type ``T``. +- [`UnionToIntersection`](https://ts-roids.ashgw.me/types/UnionToIntersection.html) - As the name implies, it turns a union into an intersection. +- [`Vals`](https://ts-roids.ashgw.me/types/Vals.html) - Get the set of type values in a given object. +- [`Xor`](https://ts-roids.ashgw.me/types/Xor.html) - Exclusive ``OR`` between two boolean types ``B1`` and ``B2``. #### Decorators diff --git a/__pycache__/replace.cpython-311.pyc b/__pycache__/replace.cpython-311.pyc new file mode 100644 index 00000000..d42c602a Binary files /dev/null and b/__pycache__/replace.cpython-311.pyc differ diff --git a/src/types.ts b/src/types.ts index 77c480e5..f00402b5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1987,3 +1987,5 @@ export type DeepNotRequired = T extends UnknownFunction : { [K in Keys]+?: IfExtends, T[K]>; }; + +