ZhijiangTang/dsh-url-tools

ZhijiangTang★ 0JavaScript最后同步: 2026-08-15

在 GitHub 打开

DSH plugin: URL parse / tracking-param cleanup / encode-decode / redirect expansion

README 摘要

dsh-url-tools DSH URL 工具插件。注册一个 url tool 工具,提供 URL 解析、跟踪参数清理、字符串编解码、重定向展开四种能力。 零依赖、纯 ESM、无构建 。 简介 - 工具名: url tool - 能力: parse (解析)/ clean (清理跟踪参数)/ decode (解码)/ encode (编码)/ expand (展开重定向)。 - 行为: 永不抛异常 。参数错误、非法 URL、网络错误、非法 % 序列都折叠为 { ok: false, error } ;成功返回 { ok: true, ... } ,且始终带回 action 回显。 安装 参数 参数 类型 必填 说明 action enum ✅ parse / clean / decode / encode / expand url string ✅ 目标 URL( decode / encode 时是待处理字符串) action 表 action 输入 输出( ok: true ) 失败 parse 任意合法 URL { scheme, host, port, pathname, search, hash, username, params } ; params 为 key → [值...] ,重复键合并为数组 ok: false + error (非法 URL) clean 含跟踪参数的 URL { url, removed, search } : url 清理后完整 URL、 removed 被删参数键数组、 search 原始 query 串 ok: false + error (非法 URL) decode 百分号编码串 { input, output } ,整串 decodeURIComponent ok: false + error (非法 % 序列) encode 任意字符串 { input, output } ,整串 encodeURIComponent — expand 任意 http/https URL { finalUrl, hops, statuses } ; statuses 为每跳状态码(含末跳非 3xx) ok: false + error (网络错/非法 URL/非法 Location) parse 输出示例 跟踪参数清单 clean 只删 以下参数,其余(含 ref 、 gclsrc 等)一律保留: - utm (任意 utm 前缀,如 utm source / utm medium / utm campaign / utm term / utm content / utm id ) - fbclid 、 gclid 、 msclkid 、 mc cid 、 mc eid 、 yclid 、 wickedid 匹配对大小写…

在 GitHub 查看完整 README →
工具/开发deepseek-harnessdsh-pluginsearch

分类