mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
refactor: remove certd v1 code
This commit is contained in:
@@ -59,11 +59,21 @@ export class Registry<T extends typeof AbstractRegistrable> {
|
||||
getDefineList() {
|
||||
const list = [];
|
||||
for (const key in this.storage) {
|
||||
const PluginClass = this.storage[key];
|
||||
// @ts-ignore
|
||||
const plugin = new PluginClass();
|
||||
list.push({ ...plugin.define, key });
|
||||
const define = this.getDefine(key);
|
||||
if (define) {
|
||||
list.push({ ...define, key });
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
getDefine(key: string) {
|
||||
const PluginClass = this.storage[key];
|
||||
if (!PluginClass) {
|
||||
return;
|
||||
}
|
||||
// @ts-ignore
|
||||
const plugin = new PluginClass();
|
||||
return plugin.define;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user