0.1.1 • Published 5 months ago
@ara-web/p-hintjens v0.1.1
P-Hintjens
This package is named in Pieter Hintjens honor.
Another name of the package that describes its purpose is Typescript enhancement. Which simply adds additional functions that simplifies your work flow.
Useful scripts you can take from this package:
- 🤖 Traits adds additional methods that works with the Typescript data types. List of traits and example utility they could provide:
- Array –
isEqualArraymakes sure two arrays have the same element data. - Enum –
enumValuesandenumKeysreturns list of values or keys from the defined enum. - Object –
deepCopycreates a new copy of the object by value. - String –
capitalizeFirstLettersimply makes the first letter of the string uppercase.
- Array –
- 📝 Ara Link adds various types of links between objects.
- Ara Link – A generic Link that could link to any resource, not only text value.
- Module Link – either a file url or a Purl. Used to create module IDs.
- 🛠️ Debug Much better version of
console.logthat puts intends as the code flow enters into a new function. - 🔌 Interfaces various interfaces to cast object into this interface.
- get-text – cast object into an interface with
getText() => stringmethod.
- get-text – cast object into an interface with
- 🔒 Result return
Result<ReturnType>from function, and if the result is error, don't throw exceptions.
The decorators
The staticImplements allows creating interfaces with the static methods.
URL: @ara-web/p-hintjens?id=ObjectTraits.staticImplements#traits/traits/object-traits.
Roadmap
- Add arbitrary amount of data in the Debug.log();