Skip to content

Instantly share code, notes, and snippets.

View LorisSigrist's full-sized avatar
🇨🇭

Loris Sigrist LorisSigrist

🇨🇭
View GitHub Profile
@LorisSigrist
LorisSigrist / ResultMatcher.js
Last active October 12, 2023 08:29
Declarative Error Handling in JS
/**
* The configuration for a ResultMatcher Strategy.
*
* @template Prototype
* @template ReturnType
* @typedef {{
* prototype: { new (): Prototype; } | { prototype: Prototype; },
* handler: (instance: Prototype) => ReturnType;
* }} Strategy
*/