MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / isURL

Function isURL

frontend/packages/common/src/utils/curl.ts:348–356  ·  view source on GitHub ↗

* Check if `s` looks like a url.

(s: string)

Source from the content-addressed store, hash-verified

346 */
347
348function isURL(s: string) {
349 try {
350 const URLObj = new URL(s.trim())
351 if (!URLObj.hostname) return false
352 return true
353 } catch (e) {
354 return false
355 }
356}
357const parseUrl2QueryParams = (url: string, isCompleteUrl = true) => {
358 const index = url.indexOf('?')
359 if (index === -1 && isCompleteUrl) {

Callers 1

parseCurlMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected