MCPcopy Create free account
hub / github.com/VirtualHotBar/NetMount / add

Method add

src/repository/storageRepository.ts:186–203  ·  view source on GitHub ↗

* 添加存储

(storage: StorageList)

Source from the content-addressed store, hash-verified

184 * 添加存储
185 */
186 add(storage: StorageList): void {
187 // 检查是否已存在
188 if (this.exists(storage.name)) {
189 throw AppError.validation(`Storage "${storage.name}" already exists`, {
190 name: storage.name,
191 })
192 }
193
194 this.cache.push(storage)
195
196 if (this.config.enableEventEmitter) {
197 this.emit(STORAGE_EVENTS.ADDED, {
198 type: 'added',
199 storage,
200 timestamp: new Date(),
201 })
202 }
203 }
204
205 /**
206 * 移除存储

Callers 3

concurrentFetchFunction · 0.80
runStepFunction · 0.80
safeAddStorageFunction · 0.80

Calls 2

existsMethod · 0.95
validationMethod · 0.80

Tested by

no test coverage detected