检测继承路径
使用 lodash _.hasIn 检测路径是否存在
检测对象(含继承属性)中是否存在指定路径。
**亮点:**
- 使用 lodash `_.hasIn`
- 检查自有和继承属性
- 返回 true 或 false
**示例:**
- 输入:`{"user":{"name":"Ada"}}`
- 路径:`user.name`
- 结果:`true`
API 文档
请求端点
POST /zh/api/tools/has-in-path
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| inputData | textarea | 是 | 输入 JSON 对象或数组 |
| path | text | 是 | 要检查的属性路径 |
响应格式
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
文本:
文本
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-has-in-path": {
"name": "has-in-path",
"description": "使用 lodash _.hasIn 检测路径是否存在",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=has-in-path",
"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]