MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / optionalString

Function optionalString

src/app/service/agent/core/tools/param_utils.ts:24–29  ·  view source on GitHub ↗
(args: Record<string, unknown>, name: string)

Source from the content-addressed store, hash-verified

22
23/** 获取可选字符串参数 */
24export function optionalString(args: Record<string, unknown>, name: string): string | undefined {
25 const val = args[name];
26 if (val == null) return undefined;
27 if (typeof val === "string") return val;
28 return String(val);
29}
30
31/** 获取可选数字参数(支持字符串转数字) */
32export function optionalNumber(args: Record<string, unknown>, name: string): number | undefined {

Callers 2

createTaskToolsFunction · 0.90
createTabToolsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected