← 返回列表
D

dsh-case

v0.1.0 · 3 天前发布

DSH plugin: case/naming conversion tool (case_convert).

dsh-pluginnamingutility

README

dsh-case

DSH 插件:命名/大小写风格转换工具,注册一个 case_convert 工具。

纯 ESM、零依赖、无构建步骤。

安装

sh
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 对象):

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 |

版本兼容矩阵

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-case
Repo
Engines
{}
Weekly DL
0
Monthly DL
0
dsh.bundle
{"bundle":{"patch":"./cordis.patch.yml"}}