示例工程 11-template-literal-types

11-template-literal-types/02-camel-case/README.md

markdown · 0.4 KB

运行:11 · camel-case

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

# 02 · camel-case
 
**演示**:用 `${infer Head}_${infer Tail}` 递归拆分字符串,把 `snake_case` 转成 `camelCase`。
**运行**:无运行时输出;Console 为空。
**类型检查**:`node node_modules/typescript/bin/tsc -p examples/11-template-literal-types/02-camel-case/tsconfig.types.json`
**注意**:`CamelCaseKeys` 只改类型键,运行时要真正改名仍需手写映射函数。