← 返回列表
D

dsh-url-tools

v0.1.1 · 1 天前发布

DSH plugin: URL parse/clean/decode/encode/expand tool (url_tool), zero-dependency pure ESM.

dsh-pluginurlutility

README

dsh-url-tools

DSH URL 工具插件。注册一个 url_tool 工具,提供 URL 解析、跟踪参数清理、字符串编解码、重定向展开四种能力。零依赖、纯 ESM、无构建

简介

  • 工具名:url_tool

  • 能力:parse(解析)/ clean(清理跟踪参数)/ decode(解码)/ encode(编码)/ expand(展开重定向)。

  • 行为:永不抛异常。参数错误、非法 URL、网络错误、非法 % 序列都折叠为 { ok: false, error };成功返回 { ok: true, ... },且始终带回 action 回显。
  • 安装

    sh
    dsh plugin --profile <name> add file:./plugins/dsh-url-tools

    或发布后:


    dsh plugin --profile <name> add dsh-url-tools

    参数

    | 参数 | 类型 | 必填 | 说明 |
    |---|---|---|---|
    | 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

    版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ✅ 兼容 cordis patch ✅
    dsh@0.1.0 ✅ 兼容 标准 patch ✅
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    MIT
    npm
    dsh-url-tools
    Repo
    Engines
    {}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {"bundle":{"patch":"./cordis.patch.yml"}}