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

Function validateStorageInput

src/controller/storage/create.ts:52–67  ·  view source on GitHub ↗

* 统一输入验证

(
  name: string,
  type: string,
  parameters: ParametersType
)

Source from the content-addressed store, hash-verified

50 * 统一输入验证
51 */
52function validateStorageInput(
53 name: string,
54 type: string,
55 parameters: ParametersType
56): { valid: boolean; error?: string } {
57 const nameError = validateStorageName(name)
58 if (nameError) return { valid: false, error: nameError }
59
60 const typeError = validateStorageType(type)
61 if (typeError) return { valid: false, error: typeError }
62
63 const paramError = validateParameters(parameters)
64 if (paramError) return { valid: false, error: paramError }
65
66 return { valid: true }
67}
68
69async function createStorage(
70 name: string,

Callers 1

createStorageFunction · 0.85

Calls 3

validateStorageTypeFunction · 0.85
validateParametersFunction · 0.85
validateStorageNameFunction · 0.70

Tested by

no test coverage detected