@plattar/sdk-core
Advanced tools
Comparing version
@@ -17,2 +17,3 @@ /** | ||
static get type(): string; | ||
static newInstance<T extends CoreObject<CoreObjectAttributes>>(): T; | ||
get type(): string; | ||
@@ -19,0 +20,0 @@ /** |
@@ -31,2 +31,5 @@ "use strict"; | ||
} | ||
static newInstance() { | ||
return (new this()); | ||
} | ||
get type() { | ||
@@ -33,0 +36,0 @@ return this.constructor.type; |
@@ -1,2 +0,2 @@ | ||
import { type CoreObject } from './core-object'; | ||
import { CoreObjectAttributes, type CoreObject } from './core-object'; | ||
/** | ||
@@ -16,2 +16,6 @@ * This object provides runtime functionality to access object types for construction | ||
static get(key: string): (typeof CoreObject) | null; | ||
/** | ||
* Generates a new instance of the object provided a key, otherwise returns null | ||
*/ | ||
static newInstance<T extends CoreObject<CoreObjectAttributes>>(key: string): T | null; | ||
} |
@@ -24,3 +24,10 @@ "use strict"; | ||
} | ||
/** | ||
* Generates a new instance of the object provided a key, otherwise returns null | ||
*/ | ||
static newInstance(key) { | ||
const obj = this.get(key); | ||
return obj ? obj.newInstance() : null; | ||
} | ||
} | ||
exports.GlobalObjectPool = GlobalObjectPool; |
@@ -59,3 +59,3 @@ "use strict"; | ||
output += '\t}\n'; | ||
output += `}\nGlobalObjectPool.register(${className});\n`; | ||
output += `}\nGlobalObjectPool.register(<any>${className});\n`; | ||
return { | ||
@@ -62,0 +62,0 @@ name: schemaInstance.type.replaceAll('_', '-'), |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.163.3"; | ||
declare const _default: "1.163.4"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "1.163.3"; | ||
exports.default = "1.163.4"; |
{ | ||
"name": "@plattar/sdk-core", | ||
"version": "1.163.3", | ||
"version": "1.163.4", | ||
"description": "Core SDK Module for Generative SDK using API Core", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
45786
1.27%1136
1.34%