Repository navigation
v0.1.0-alpha.2.1
Pre-releasetrycatch-lib: v0.1.0-alpha.2.1
🚀 Alpha Release: Incremental Updates 🧪
This release encompasses changes introduced subsequent to the initial v0.1.0-alpha.0 release, culminating in version v0.1.0-alpha.2.1.
This remains an alpha version intended for evaluation and feedback. The API is subject to modification, and its utilization in production environments is not recommended.
✨ Key Enhancements Since v0.1.0-alpha.0
-
Version Control: The package version has been incremented to
0.1.0-alpha.2.1to reflect internal modifications and refinements. -
Documentation Augmentation: The
README.mdfile has undergone significant enhancement, incorporating comprehensive examples for improved clarity and usability:- Elucidated examples demonstrating the application of
trycatchwith both asynchronous (fetch) and synchronous (JSON.parse) functions. - Detailed examples illustrating the usage of the
makeAsyncutility and the requisite handling of theMakeAsyncErrorreturn type. - Expanded API reference section within the
README.md, providing comprehensive specifications and type signatures formakeAsyncandMakeAsyncError, alongside coretrycatchcomponents.
- Elucidated examples demonstrating the application of
-
makeAsyncUtility:- The
makeAsyncutility and its associatedMakeAsyncErrorare now patched with new code to make it work as intended and explicitly documented and presented as an integral part of the library's API. ⚠️ Caveat: Attention is drawn to the inherent limitations in the reliability of the runtime check employed bymakeAsyncfor detecting pre-existing asynchronous function characteristics. This mechanism may exhibit inaccuracies within bundled or transpiled code contexts. Exercise caution during implementation.
import { makeAsync, MakeAsyncError } from "trycatch-lib"; function synchronousFunction(x: number): number { // Executes a synchronous operation return x * 2; } const newAsyncFunc = makeAsync(synchronousFunction); if (potentiallyAsyncFunc instanceof MakeAsyncError) { console.error("Failed to wrap:", potentiallyAsyncFunc.message); } else { (async () => { // Invokes the asynchronously adapted function const result = await potentiallyAsyncFunc(10); console.log(result); // Output: 20 })(); }
- The
⬇️ Installation (Latest Alpha Release)
To evaluate the latest alpha version (v0.1.0-alpha.2.1 or via the @alpha tag):
# Using pnpm
pnpm add trycatch-lib@alpha
# Using npm
npm install trycatch-lib@alpha
# Using yarn
yarn add trycatch-lib@alpha🛠️ Usage Guidelines
Refer to the README.md file for comprehensive usage examples and detailed API documentation.
📢 Feedback Solicitation
Your insights and feedback regarding these alpha versions are highly valued. Please report any identified issues or suggested enhancements via the GitHub repository. Your contributions are greatly appreciated.
Full Changelog: 0.1.0-alpha.0...0.1.0-alpha2.1