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

Method validateCurl

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

基础校验,验证 curl 字符串的合法性

()

Source from the content-addressed store, hash-verified

88
89 /** 基础校验,验证 curl 字符串的合法性 */
90 validateCurl(): string | void {
91 if (!this.curlStr || typeof this.curlStr !== 'string') {
92 throw `curl 字符串为空或不是字符串`
93 }
94 const trimmedCurl = this.curlStr.trim()
95 if (!trimmedCurl.toLowerCase().startsWith('curl')) {
96 throw `不是以 curl 开头的字符串`
97 }
98 }
99 /**
100 * 解析 curl 字符串后获取到的 body 参数
101 */

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected