dsh-case
Manifest validDSH plugin: naming case converter (camelCase/snake_case/kebab-case/PascalCase/...)
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 主要作为结果中的标注,不影响转换正确性。
Comments
Loading…
Similar plugins
by uckkk
蛇形命名
★ 0
MIT
JavaScript
Aug 19, 2026
dsh plugin --profile web add dsh-snakecaseby uckkk
短横线命名
★ 0
MIT
JavaScript
Aug 19, 2026
dsh plugin --profile web add dsh-kebabcaseby uckkk
帕斯卡命名
★ 0
MIT
JavaScript
Aug 19, 2026
dsh plugin --profile web add dsh-pascalcaseby TheYoungChen
DeepSeek Harness plugin market - browse, search & install dsh-plugin topic plugins (dsh 插件市场:浏览/搜索/安装插件)
★ 4
↓ 271/wk
MIT
JavaScript
Oct 8, 2026
dsh plugin --profile web add dsh-plugin-marketby builtin-pb
The single plugin you need for DSH — build, test, diagnose, and maintain DeepSeek Harness plugins and core.
★ 7
MIT
JavaScript
Sep 19, 2026
dsh plugin --profile web add dsh-developerby Momojie-S
DSH plugin: per-workspace .env injection for shell subprocesses
★ 2
MIT
JavaScript
Sep 12, 2026
dsh plugin --profile web add @momojie-s/dsh-workspace-env