Rocky_Mountain_Vending/.pnpm-store/v10/files/ed/77db1fd0a25cf63e93c26d3afeb4a6895af7b2a2a62d9bcf1a72da883330b1cfe21b43286428d11964364c1ff7dbf5d44653be30c5c027528efda061269e72
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

20 lines
789 B
Text

/**
* Used to create Error subclasses until the community moves away from ES5.
*
* This is because compiling from TypeScript down to ES5 has issues with subclassing Errors
* as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123
*
* @param createImpl A factory function to create the actual constructor implementation. The returned
* function should be a named function that calls `_super` internally.
*/
export function createErrorClass<T>(createImpl: (_super: any) => any): T {
const _super = (instance: any) => {
Error.call(instance);
instance.stack = new Error().stack;
};
const ctorFunc = createImpl(_super);
ctorFunc.prototype = Object.create(Error.prototype);
ctorFunc.prototype.constructor = ctorFunc;
return ctorFunc;
}