UNPKG

@glandjs/core

Version:

Glands is a web framework for Node.js (@core)

20 lines (19 loc) 540 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InstanceWrapper = void 0; class InstanceWrapper { constructor(token, instance) { this.token = token; this.instance = instance; } get id() { return this.token?.toString() || this.token?.name || 'unknown'; } getInstance() { if (!this.instance) { throw new Error(`Instance ${this.id} not initialized`); } return this.instance; } } exports.InstanceWrapper = InstanceWrapper;