UNPKG

@storm-software/k8s-tools

Version:

Tools for managing Kubernetes (k8s) infrastructure within a Nx workspace.

22 lines (20 loc) 640 B
// src/utils/ensure-init.ts var ensureInitialized = (target, propertyKey, descriptor) => { const originalMethod = descriptor.value; descriptor.value = async function(...arguments_) { const self = this; if (self.initialized === void 0 || typeof self.initialize !== "function") { throw new TypeError( `The ensureInitialized decorator can only be applied in classes with an 'initialized' property and 'initialize' method.` ); } if (!self.initialized) { await self.initialize(); } return originalMethod.apply(this, arguments_); }; return descriptor; }; export { ensureInitialized };