MCPcopy
hub / github.com/ZToolsCenter/ZTools / loadDynamicFeatures

Method loadDynamicFeatures

src/main/api/plugin/feature.ts:167–182  ·  view source on GitHub ↗

* 从数据库加载动态 features

(pluginName: string)

Source from the content-addressed store, hash-verified

165 * 从数据库加载动态 features
166 */
167 public loadDynamicFeatures(pluginName: string): DynamicFeature[] {
168 try {
169 const key = this.getDynamicFeaturesDocId(pluginName)
170 const doc = lmdbInstance.get(key)
171
172 if (doc && doc.data) {
173 const data: DynamicFeaturesData = JSON.parse(doc.data)
174 return data.features || []
175 }
176
177 return []
178 } catch (error) {
179 console.error('[PluginFeature] loadDynamicFeatures error:', error)
180 return []
181 }
182 }
183
184 /**
185 * 保存动态 features 到数据库

Callers 6

setupIPCMethod · 0.95
findCommandInPluginMethod · 0.80
processRedirectMethod · 0.80
addToHistoryMethod · 0.80
getAllPluginsMethod · 0.80

Calls 2

getMethod · 0.65

Tested by

no test coverage detected