Core basics for TypeScript applications
StemThis library is not from the world of nano trends, however, everything (or almost everything) in it is used in almost every project that I personally start. Therefore, perhaps you will need it too.
src directory and see what is hidden there.Don't forget about the src/index.ts file - there is probably everything that you will definitely use daily during active development.
Most often used type is Rec. Yes, it is very similar to the built-in type Record, but it has important differences:
1. In the generic, it takes two parameters, but the type of the value comes first, not the key. The second parameter is the key type, and it is not required, since the string type is used by default. In my observations, this removes cognitive load, as this is the most common use of this type.
2. Type of keys is limited by ObjectKey tuple, which allows to use only string, number and symbol types. This is done in order to avoid the possibility of using, for example, null or undefined as a key, which can lead to unpredictable consequences.
Type Rec has several modifications: PRec, URec, ARec.
Perhaps the most used type is PRec - it differs from the original in that all its fields are optional.
In turn, URec and ARec are simple shortcuts for Rec with unknown and any as the value type respectively.
As a rule, this library is enough to abandon the use of such libraries as lodash.
crypto and buffer.
#### License
This project is licensed under the LGPL-3.0 License – see the LICENSE file for details.