dsh-case
已验证 · 实测可装 ZhijiangTang
✓ 持续维护 基于 3 个官方 DSH 包
0Stars
0Forks
0未关闭 issue
—语言
2026-08-16最近推送
跨平台平台
功能简介
DSH plugin: naming case converter (camelCase/snake_case/kebab-case/PascalCase/...)
我们的评价
可用 — 实测通过,早期项目
可用 — 实测通过,早期项目
DSH plugin: naming case converter (camelCase/snake_case/kebab-case/PascalCase/...) 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-case
DSH 插件:命名/大小写风格转换工具,注册一个 case_convert 工具。
纯 ESM、零依赖、无构建步骤。
安装
dsh plugin --profile <name> add file:./plugins/dsh-case
# 或发布后
dsh plugin --profile <name> add dsh-case
工具 case_convert
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
text |
string | 是 | 待转换文本 |
target |
string(enum) | 是 | 目标风格 |
source |
string(enum) | 否 | 源风格,默认 auto 自动检测 |
返回值(规范 JSON 对象):
{ "input": "...", "target": "camelCase", "source": "snake_case", "output": "...", "words": ["..."] }
各 target 示例
以 hello_world(snake_case)为输入:
| target | 输出 |
|---|---|
camelCase |
helloWorld |
PascalCase |
HelloWorld |
snake_case |
hello_world |
kebab-case |
hello-world |
CONSTANT_CASE |
HELLO_WORLD |
UPPER |
HELLO WORLD |
lower |
hello world |
Title Case |
Hello World |
分词规则
- 按分隔符
-、_、空白、.切词。 - 在无分隔符片段内按大小写边界切词:
- 小写 → 大写(
helloWorld→hello/World) - 连续大写后接小写(
HTTPApi→HTTP/Api) - 数字后接「大写 + 小写」(
my2Factor→my2/Factor)
- 小写 → 大写(
- 数字粘合到相邻单词,不单独成词:
version2→version2;开头的2FA保持为一个整体不拆分。 - 空输入或纯符号输入原样返回,
words为空数组。
source 用于 auto 检测时的判定(分隔符 + 连续大写规则);分词算法对全部分隔符与大小写边界一视同仁,因此 source 主要作为结果中的标注,不影响转换正确性。
安装
🧩 让 Agent 自动装(推荐)
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-case」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:ZhijiangTang/dsh-case Headless(CLI)profile:
dsh plugin --profile headless add github:ZhijiangTang/dsh-case 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。