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

Function buildFullPath

src/utils/openlist/request.ts:16–27  ·  view source on GitHub ↗

* 构建完整 URL(包含查询参数)

(path: string, queryData?: object)

Source from the content-addressed store, hash-verified

14 * 构建完整 URL(包含查询参数)
15 */
16function buildFullPath(path: string, queryData?: object): string {
17 const searchParams = new URLSearchParams()
18 if (queryData) {
19 Object.entries(queryData).forEach(([key, value]) => {
20 if (value !== undefined && value !== null) {
21 searchParams.append(key, String(value))
22 }
23 })
24 }
25 const queryString = searchParams.toString()
26 return `${openlistInfo.endpoint.url}${path}${queryString ? '?' + queryString : ''}`
27}
28
29/**
30 * 统一处理 API 响应

Callers 2

openlist_api_getFunction · 0.85
openlist_api_postFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected