深度默认值
使用 lodash _.defaultsDeep 应用深度默认值
为未定义属性递归分配默认值。
**亮点:**
- 使用 lodash `_.defaultsDeep`
- 深度应用到嵌套对象
- 只填充 undefined 属性
**示例:**
- 目标:`{"a":{"b":1}}`
- 来源 1:`{"a":{"b":2,"c":3}}`
- 结果:`{"a":{"b":1,"c":3}}`
API 文档
请求端点
POST /zh/api/tools/defaults-deep
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| targetObject | textarea | 是 | 输入目标 JSON 对象 |
| source1 | textarea | 是 | 第一个来源对象 |
| source2 | textarea | 否 | 可选的来源对象 |
| source3 | textarea | 否 | 可选的来源对象 |
响应格式
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
文本:
文本
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-defaults-deep": {
"name": "defaults-deep",
"description": "使用 lodash _.defaultsDeep 应用深度默认值",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=defaults-deep",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。
如果遇见问题,请联系我们:[email protected]