mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
refactor: fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
export class Registry {
|
||||
constructor () {
|
||||
this.collection = new Map()
|
||||
this.collection = {}
|
||||
}
|
||||
|
||||
install (target) {
|
||||
@@ -8,7 +8,7 @@ export class Registry {
|
||||
return
|
||||
}
|
||||
if (this.collection == null) {
|
||||
this.collection = new Map()
|
||||
this.collection = {}
|
||||
}
|
||||
let defineName = target.define ? target.define().name : null
|
||||
if (defineName == null) {
|
||||
@@ -22,15 +22,15 @@ export class Registry {
|
||||
if (!key || value == null) {
|
||||
return
|
||||
}
|
||||
this.collection.set(key, value)
|
||||
this.collection[key] = value
|
||||
}
|
||||
|
||||
get (name) {
|
||||
if (name) {
|
||||
return this.collection.get(name)
|
||||
return this.collection[name]
|
||||
}
|
||||
|
||||
throw new Error(`${name} not found`)
|
||||
throw new Error(`${name} cant blank`)
|
||||
}
|
||||
|
||||
getCollection () {
|
||||
|
||||
@@ -123,7 +123,7 @@ export class Executor {
|
||||
}
|
||||
|
||||
deployTrace.set({ value: { status: 'success', remark: '执行成功' } })
|
||||
trace.set({ type: 'result', value: { status: 'success', remark: '部署成功' } })
|
||||
trace.set({ type: 'result', value: { status: 'success', remark: '执行成功' } })
|
||||
} catch (e) {
|
||||
deployTrace.set({ value: { status: 'error', remark: '执行失败:' + e.message } })
|
||||
trace.set({ type: 'result', value: { status: 'error', remark: deployName + '执行失败:' + e.message } })
|
||||
|
||||
Reference in New Issue
Block a user