From 762859f9e6f39633b41f049e0490bfb2d10cc68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Sun, 28 Jul 2024 20:56:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=82=B9=E5=88=86=E5=89=B2?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E7=9B=AE=E6=A0=87=EF=BC=9B=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E6=9B=B4=E6=96=B0=E4=B8=BA1.0.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 + README.md | 6 +- package-comment.jsonc | 46 ++++- package.json | 36 +++- src/main-code/conversion.ts | 12 +- src/main-code/transform.ts | 3 + src/test/extension.test.ts | 41 +++-- src/test/test-case.ts | 234 +++++++++++++++++++++++-- src/type-definition/SupportCaseType.ts | 80 +++++++++ src/type-definition/TestCaseType.ts | 5 + 10 files changed, 423 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c800efc..ac48826 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --> +## 1.0.10 + +### Added + +- Add 4 new conversion types: Dot Case, Dot Camel Case, Dot Pascal Case, Dot Upper Case (新增 4 种转换类型: 点分隔 + 全小写/小驼峰/大驼峰/全大写) + ## 1.0.8 ### Added diff --git a/README.md b/README.md index 4535177..7d5e5db 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ Or right-click on the selected text -> Convert string to... | 空格分隔 + 小驼峰(驼峰)命名 | Space Camel Case | foo Bar | | 空格分隔 + 大驼峰(帕斯卡)命名 | Space Pascal Case | Foo Bar | | 空格分隔 + 全大写命名 | Space Upper Case | FOO BAR | +| 点分隔命名 | Dot Case | foo.bar | +| 点分隔 + 小驼峰(驼峰)命名 | Dot Camel Case | foo.Bar | +| 点分隔 + 大驼峰(帕斯卡)命名 | Dot Pascal Case | Foo.Bar | +| 点分隔 + 全大写命名 | Dot Upper Case | FOO.BAR | | 全小写 | Lower Case | foo_bar / foobar | | 全大写 | Upper Case | FOO_BAR / FOOBAR | @@ -81,7 +85,7 @@ Or right-click on the selected text -> Convert string to... #### 关于文本选区... - 可以先按住 `Alt` 键不放,再鼠标先后选中多个选区 - You can first hold down `Alt`, and then use the mouse to select multiple selection + You can first hold down `Alt`, and then use the mouse to select multiple selection - 可以先按住 `Shift + Alt` 键不放,再按下鼠标左键,使用鼠标滑过需要选中的区块 You can first hold down `Shift + Alt`, then press the left mouse button, and use the mouse to slide over the block that needs to be selected - 可以通过 `Ctrl + D` 快捷键选中光标所在的单词 diff --git a/package-comment.jsonc b/package-comment.jsonc index af46b47..43e5678 100644 --- a/package-comment.jsonc +++ b/package-comment.jsonc @@ -2,9 +2,9 @@ // 插件 id 及名称 "name": "variable-conversion", "displayName": "Variable Conversion", - "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, lower, upper case, and more.", + "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、点分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, dot, lower, upper case, and more.", // 版本号 - "version": "1.0.8.1", + "version": "1.0.10", // logo "icon": "image/logo.png", "publisher": "coder-xiaomo", @@ -146,7 +146,24 @@ "command": "variable-conversion.toSpaceCamelCase", "title": "空格分隔 + 小驼峰(驼峰)命名 (Space Camel Case) [ foo Bar ]" }, - // group-5-upper-lower + // group-5-dot + { + "command": "variable-conversion.toDotCase", + "title": "点分隔命名 (Dot Case) [ foo bar ]" + }, + { + "command": "variable-conversion.toDotUpperCase", + "title": "点分隔 + 全大写命名 (Dot Upper Case) [ FOO BAR ]" + }, + { + "command": "variable-conversion.toDotPascalCase", + "title": "点分隔 + 大驼峰(帕斯卡)命名 (Dot Pascal Case) [ Foo Bar ]" + }, + { + "command": "variable-conversion.toDotCamelCase", + "title": "点分隔 + 小驼峰(驼峰)命名 (Dot Camel Case) [ foo Bar ]" + }, + // group-6-upper-lower { "command": "variable-conversion.toLowerCase", "title": "全小写 (Lower Case) [ foobar ]" @@ -266,14 +283,31 @@ "command": "variable-conversion.toSpaceCamelCase", "group": "group-4-space@4" }, - // group-5-upper-lower + // group-5-dot + { + "command": "variable-conversion.toDotCase", + "group": "group-5-dot@1" + }, + { + "command": "variable-conversion.toDotUpperCase", + "group": "group-5-dot@2" + }, + { + "command": "variable-conversion.toDotPascalCase", + "group": "group-5-dot@3" + }, + { + "command": "variable-conversion.toDotCamelCase", + "group": "group-5-dot@4" + }, + // group-6-upper-lower { "command": "variable-conversion.toLowerCase", - "group": "group-5-upper-lower@1" + "group": "group-6-upper-lower@1" }, { "command": "variable-conversion.toUpperCase", - "group": "group-5-upper-lower@2" + "group": "group-6-upper-lower@2" } // 隐藏菜单项 // { diff --git a/package.json b/package.json index 2838a1e..a09765d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "variable-conversion", "displayName": "Variable Conversion", - "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, lower, upper case, and more.", - "version": "1.0.9", + "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、点分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, dot, lower, upper case, and more.", + "version": "1.0.10", "icon": "image/logo.png", "publisher": "coder-xiaomo", "engines": { @@ -115,6 +115,22 @@ "command": "variable-conversion.toSpaceCamelCase", "title": "空格分隔 + 小驼峰(驼峰)命名 (Space Camel Case) [ foo Bar ]" }, + { + "command": "variable-conversion.toDotCase", + "title": "点分隔命名 (Dot Case) [ foo bar ]" + }, + { + "command": "variable-conversion.toDotUpperCase", + "title": "点分隔 + 全大写命名 (Dot Upper Case) [ FOO BAR ]" + }, + { + "command": "variable-conversion.toDotPascalCase", + "title": "点分隔 + 大驼峰(帕斯卡)命名 (Dot Pascal Case) [ Foo Bar ]" + }, + { + "command": "variable-conversion.toDotCamelCase", + "title": "点分隔 + 小驼峰(驼峰)命名 (Dot Camel Case) [ foo Bar ]" + }, { "command": "variable-conversion.toLowerCase", "title": "全小写 (Lower Case) [ foobar ]" @@ -194,6 +210,22 @@ "command": "variable-conversion.toSpaceCamelCase", "group": "group-4-space@4" }, + { + "command": "variable-conversion.toDotCase", + "group": "group-5-dot@1" + }, + { + "command": "variable-conversion.toDotUpperCase", + "group": "group-5-dot@2" + }, + { + "command": "variable-conversion.toDotPascalCase", + "group": "group-5-dot@3" + }, + { + "command": "variable-conversion.toDotCamelCase", + "group": "group-5-dot@4" + }, { "command": "variable-conversion.toLowerCase", "group": "group-5-upper-lower@1" diff --git a/src/main-code/conversion.ts b/src/main-code/conversion.ts index 9e5f284..789bbcc 100644 --- a/src/main-code/conversion.ts +++ b/src/main-code/conversion.ts @@ -13,7 +13,7 @@ import { transformMutliLineText, transformText } from './transform'; * @since 2024-04-04 */ export function caseConversion(targetCase: SupportCase, str: string, eol: EOL, cutText: Array | undefined = undefined): string { - let spaceCharacter: '-' | '_' | ' ' | undefined = undefined; + let spaceCharacter: '-' | '_' | ' ' | '.' | undefined = undefined; switch (targetCase) { default: case SupportCase.CAMEL_CASE: // 小驼峰(驼峰)命名 @@ -38,6 +38,12 @@ export function caseConversion(targetCase: SupportCase, str: string, eol: EOL, c case SupportCase.SPACE_UPPER_CASE: // 空格分隔 + 全大写命名 spaceCharacter = ' '; break; + case SupportCase.DOT_CASE: // 点分隔命名 + case SupportCase.DOT_CAMEL_CASE: // 点分隔 + 小驼峰(驼峰)命名 + case SupportCase.DOT_PASCAL_CASE: // 点分隔 + 大驼峰(帕斯卡)命名 + case SupportCase.DOT_UPPER_CASE: // 点分隔 + 全大写命名 + spaceCharacter = '.'; + break; case SupportCase.LOWER_CASE: // 全小写 return str.toLowerCase(); case SupportCase.UPPER_CASE: // 全大写 @@ -82,6 +88,7 @@ export function caseConversion(targetCase: SupportCase, str: string, eol: EOL, c case SupportCase.SNAKE_CAMEL_CASE: // 下划线(蛇形) + 小驼峰(驼峰)命名 case SupportCase.KEBAB_CAMEL_CASE: // 中划线(连字符/脊柱式) + 小驼峰(驼峰)命名 case SupportCase.SPACE_CAMEL_CASE: // 空格分隔 + 小驼峰(驼峰)命名 + case SupportCase.DOT_CAMEL_CASE: // 点分隔 + 小驼峰(驼峰)命名 if (isFirstWord) { transformedWords.push(word); if (isCurrentWordNormal) { @@ -95,16 +102,19 @@ export function caseConversion(targetCase: SupportCase, str: string, eol: EOL, c case SupportCase.SNAKE_PASCAL_CASE: // 下划线(蛇形) + 大驼峰(帕斯卡)命名 case SupportCase.KEBAB_PASCAL_CASE: // 中划线(连字符/脊柱式) + 大驼峰(帕斯卡)命名 case SupportCase.SPACE_PASCAL_CASE: // 空格分隔 + 大驼峰(帕斯卡)命名 + case SupportCase.DOT_PASCAL_CASE: // 点分隔 + 大驼峰(帕斯卡)命名 transformedWords.push(pascalCaseWord); break; case SupportCase.SNAKE_CASE: // 下划线(蛇形)命名 case SupportCase.KEBAB_CASE: // 中划线(连字符/脊柱式)命名 case SupportCase.SPACE_CASE: // 空格分隔命名 + case SupportCase.DOT_CASE: // 点分隔命名x transformedWords.push(word); break; case SupportCase.SNAKE_UPPER_CASE: // 下划线(蛇形) + 全大写命名 case SupportCase.KEBAB_UPPER_CASE: // 中划线(连字符/脊柱式) + 全大写命名 case SupportCase.SPACE_UPPER_CASE: // 空格分隔 + 全大写命名 + case SupportCase.DOT_UPPER_CASE: // 点分隔 + 全大写命名 transformedWords.push(word.toUpperCase()); break; default: diff --git a/src/main-code/transform.ts b/src/main-code/transform.ts index 0026bc9..814f3e9 100644 --- a/src/main-code/transform.ts +++ b/src/main-code/transform.ts @@ -54,6 +54,9 @@ export function transformText(input: string): TransformTextResult { // 替换连字符为 '|' (如有多个则合并) match = match.replace(/[-_ ]+/g, '|'); + // // 替换.时跳过连续点(例如Happy.. angry) + // match = match.replace(/([^.])([.])([^.])/g, '$1|$3'); + // 拆分连续的小写字母和大写字母为多个单词 match = match.replace(/([a-z])([A-Z])/g, '$1|$2'); diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index b1d4b57..8b434e7 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -49,29 +49,34 @@ suite('Extension Test: run test case', () => { } // 验证转换 for (let eol of eolList) { - assert.strictEqual(testCase.output.camelCase, caseConversion(SupportCase.CAMEL_CASE, input, eol)); - assert.strictEqual(testCase.output.pascalCase, caseConversion(SupportCase.PASCAL_CASE, input, eol)); + assert.strictEqual(testCase.output.camelCase, caseConversion(SupportCase.CAMEL_CASE, input, eol), 'camel case test failed.'); + assert.strictEqual(testCase.output.pascalCase, caseConversion(SupportCase.PASCAL_CASE, input, eol), 'pascal case test failed.'); - assert.strictEqual(testCase.output.snakeCase, caseConversion(SupportCase.SNAKE_CASE, input, eol)); - assert.strictEqual(testCase.output.snakeCamelCase, caseConversion(SupportCase.SNAKE_CAMEL_CASE, input, eol)); - assert.strictEqual(testCase.output.snakePascalCase, caseConversion(SupportCase.SNAKE_PASCAL_CASE, input, eol)); - assert.strictEqual(testCase.output.snakeUpperCase, caseConversion(SupportCase.SNAKE_UPPER_CASE, input, eol)); + assert.strictEqual(testCase.output.snakeCase, caseConversion(SupportCase.SNAKE_CASE, input, eol), 'snake case test failed.'); + assert.strictEqual(testCase.output.snakeCamelCase, caseConversion(SupportCase.SNAKE_CAMEL_CASE, input, eol), 'snake camel case test failed.'); + assert.strictEqual(testCase.output.snakePascalCase, caseConversion(SupportCase.SNAKE_PASCAL_CASE, input, eol), 'snake pascal case test failed.'); + assert.strictEqual(testCase.output.snakeUpperCase, caseConversion(SupportCase.SNAKE_UPPER_CASE, input, eol), 'snake upper case test failed.'); + + assert.strictEqual(testCase.output.kebabCase, caseConversion(SupportCase.KEBAB_CASE, input, eol), 'kebab case test failed.'); + assert.strictEqual(testCase.output.kebabCamelCase, caseConversion(SupportCase.KEBAB_CAMEL_CASE, input, eol), 'kebab camel case test failed.'); + assert.strictEqual(testCase.output.kebabPascalCase, caseConversion(SupportCase.KEBAB_PASCAL_CASE, input, eol), 'kebab pascal case test failed.'); + assert.strictEqual(testCase.output.kebabUpperCase, caseConversion(SupportCase.KEBAB_UPPER_CASE, input, eol), 'kebab upper case test failed.'); + + assert.strictEqual(testCase.output.spaceCase, caseConversion(SupportCase.SPACE_CASE, input, eol), 'space case test failed.'); + assert.strictEqual(testCase.output.spaceCamelCase, caseConversion(SupportCase.SPACE_CAMEL_CASE, input, eol), 'space camel case test failed.'); + assert.strictEqual(testCase.output.spacePascalCase, caseConversion(SupportCase.SPACE_PASCAL_CASE, input, eol), 'space pascal case test failed.'); + assert.strictEqual(testCase.output.spaceUpperCase, caseConversion(SupportCase.SPACE_UPPER_CASE, input, eol), 'space upper case test failed.'); + + assert.strictEqual(testCase.output.dotCase, caseConversion(SupportCase.DOT_CASE, input, eol), 'dot case test failed.'); + assert.strictEqual(testCase.output.dotCamelCase, caseConversion(SupportCase.DOT_CAMEL_CASE, input, eol), 'dot camel case test failed.'); + assert.strictEqual(testCase.output.dotPascalCase, caseConversion(SupportCase.DOT_PASCAL_CASE, input, eol), 'dot pascal case test failed.'); + assert.strictEqual(testCase.output.dotUpperCase, caseConversion(SupportCase.DOT_UPPER_CASE, input, eol), 'dot upper case test failed.'); - assert.strictEqual(testCase.output.kebabCase, caseConversion(SupportCase.KEBAB_CASE, input, eol)); - assert.strictEqual(testCase.output.kebabCamelCase, caseConversion(SupportCase.KEBAB_CAMEL_CASE, input, eol)); - assert.strictEqual(testCase.output.kebabPascalCase, caseConversion(SupportCase.KEBAB_PASCAL_CASE, input, eol)); - assert.strictEqual(testCase.output.kebabUpperCase, caseConversion(SupportCase.KEBAB_UPPER_CASE, input, eol)); - - assert.strictEqual(testCase.output.spaceCase, caseConversion(SupportCase.SPACE_CASE, input, eol)); - assert.strictEqual(testCase.output.spaceCamelCase, caseConversion(SupportCase.SPACE_CAMEL_CASE, input, eol)); - assert.strictEqual(testCase.output.spacePascalCase, caseConversion(SupportCase.SPACE_PASCAL_CASE, input, eol)); - assert.strictEqual(testCase.output.spaceUpperCase, caseConversion(SupportCase.SPACE_UPPER_CASE, input, eol)); - if (testCase.output.lowerCase !== undefined) { - assert.strictEqual(testCase.output.lowerCase, caseConversion(SupportCase.LOWER_CASE, input, eol)); + assert.strictEqual(testCase.output.lowerCase, caseConversion(SupportCase.LOWER_CASE, input, eol), 'lower case test failed.'); } if (testCase.output.upperCase !== undefined) { - assert.strictEqual(testCase.output.upperCase, caseConversion(SupportCase.UPPER_CASE, input, eol)); + assert.strictEqual(testCase.output.upperCase, caseConversion(SupportCase.UPPER_CASE, input, eol), 'upper case test failed.'); } } } diff --git a/src/test/test-case.ts b/src/test/test-case.ts index 86cb2d7..2d4232c 100644 --- a/src/test/test-case.ts +++ b/src/test/test-case.ts @@ -31,6 +31,10 @@ const testGroups: Array = [ spaceCamelCase: '', spacePascalCase: '', spaceUpperCase: '', + dotCase: '', + dotCamelCase: '', + dotPascalCase: '', + dotUpperCase: '', lowerCase: '', upperCase: '', }, @@ -57,6 +61,10 @@ const testGroups: Array = [ spaceCamelCase: ' ', spacePascalCase: ' ', spaceUpperCase: ' ', + dotCase: ' ', + dotCamelCase: ' ', + dotPascalCase: ' ', + dotUpperCase: ' ', lowerCase: ' ', upperCase: ' ', }, @@ -84,6 +92,10 @@ const testGroups: Array = [ spaceCamelCase: ' \r\n ', spacePascalCase: ' \r\n ', spaceUpperCase: ' \r\n ', + dotCase: ' \r\n ', + dotCamelCase: ' \r\n ', + dotPascalCase: ' \r\n ', + dotUpperCase: ' \r\n ', lowerCase: ' \r\n ', upperCase: ' \r\n ', }, @@ -111,6 +123,10 @@ const testGroups: Array = [ spaceCamelCase: ' x \r\ny ', spacePascalCase: ' X \r\nY ', spaceUpperCase: ' X \r\nY ', + dotCase: ' x \r\ny ', + dotCamelCase: ' x \r\ny ', + dotPascalCase: ' X \r\nY ', + dotUpperCase: ' X \r\nY ', lowerCase: ' x \r\ny ', upperCase: ' X \r\nY ', }, @@ -138,6 +154,10 @@ const testGroups: Array = [ spaceCamelCase: ' \n ', spacePascalCase: ' \n ', spaceUpperCase: ' \n ', + dotCase: ' \n ', + dotCamelCase: ' \n ', + dotPascalCase: ' \n ', + dotUpperCase: ' \n ', lowerCase: ' \n ', upperCase: ' \n ', }, @@ -165,6 +185,10 @@ const testGroups: Array = [ spaceCamelCase: ' a\nb ', spacePascalCase: ' A\nB ', spaceUpperCase: ' A\nB ', + dotCase: ' a\nb ', + dotCamelCase: ' a\nb ', + dotPascalCase: ' A\nB ', + dotUpperCase: ' A\nB ', lowerCase: ' a\nb ', upperCase: ' A\nB ', }, @@ -222,6 +246,18 @@ const testGroups: Array = [ spaceUpperCase: "CHINA'S FACTORY ACTIVITY EXPANDED IN MARCH AFTER FIVE CONSECUTIVE MONTHS OF CONTRACTION,AN OFFICIAL SURVEY REVEALED ON SUNDAY,ADDING TO A RUN OF INDICATORS THAT SUGGEST THE STABILIZATION OF THE WORLD'S SECOND LARGEST ECONOMY." , + dotCase: + "china's.factory.activity.expanded.in.march.after.five.consecutive.months.of.contraction,an.official.survey.revealed.on.sunday,adding.to.a.run.of.indicators.that.suggest.the.stabilization.of.the.world's.second.largest.economy." + , + dotCamelCase: + "china'S.Factory.Activity.Expanded.In.March.After.Five.Consecutive.Months.Of.Contraction,An.Official.Survey.Revealed.On.Sunday,Adding.To.A.Run.Of.Indicators.That.Suggest.The.Stabilization.Of.The.World'S.Second.Largest.Economy." + , + dotPascalCase: + "China'S.Factory.Activity.Expanded.In.March.After.Five.Consecutive.Months.Of.Contraction,An.Official.Survey.Revealed.On.Sunday,Adding.To.A.Run.Of.Indicators.That.Suggest.The.Stabilization.Of.The.World'S.Second.Largest.Economy." + , + dotUpperCase: + "CHINA'S.FACTORY.ACTIVITY.EXPANDED.IN.MARCH.AFTER.FIVE.CONSECUTIVE.MONTHS.OF.CONTRACTION,AN.OFFICIAL.SURVEY.REVEALED.ON.SUNDAY,ADDING.TO.A.RUN.OF.INDICATORS.THAT.SUGGEST.THE.STABILIZATION.OF.THE.WORLD'S.SECOND.LARGEST.ECONOMY." + , lowerCase: "china's factory activity expanded in march after five consecutive months of contraction, an official survey revealed on sunday, adding to a run of indicators that suggest the stabilization of the world's second-largest economy." , @@ -253,6 +289,10 @@ const testGroups: Array = [ spaceCamelCase: 'entity2Map', spacePascalCase: 'Entity2Map', spaceUpperCase: 'ENTITY2MAP', + dotCase: 'entity2map', + dotCamelCase: 'entity2Map', + dotPascalCase: 'Entity2Map', + dotUpperCase: 'ENTITY2MAP', lowerCase: 'entity2map', upperCase: 'ENTITY2MAP', }, @@ -283,6 +323,10 @@ const testGroups: Array = [ spaceCamelCase: 'how Do You\bDo?\n how Do You\tDo!', spacePascalCase: 'How Do You\bDo?\n How Do You\tDo!', spaceUpperCase: 'HOW DO YOU\bDO?\n HOW DO YOU\tDO!', + dotCase: 'how.do.you\bdo?\n how.do.you\tdo!', + dotCamelCase: 'how.Do.You\bDo?\n how.Do.You\tDo!', + dotPascalCase: 'How.Do.You\bDo?\n How.Do.You\tDo!', + dotUpperCase: 'HOW.DO.YOU\bDO?\n HOW.DO.YOU\tDO!', lowerCase: 'how do you\bdo?\n how do you\tdo!', upperCase: 'HOW DO YOU\bDO?\n HOW DO YOU\tDO!', }, @@ -312,6 +356,10 @@ const testGroups: Array = [ spaceCamelCase: '今天是星期日', spacePascalCase: '今天是星期日', spaceUpperCase: '今天是星期日', + dotCase: '今天是星期日', + dotCamelCase: '今天是星期日', + dotPascalCase: '今天是星期日', + dotUpperCase: '今天是星期日', lowerCase: '今天是星期日', upperCase: '今天是星期日', }, @@ -340,6 +388,10 @@ const testGroups: Array = [ spaceCamelCase: '担心你d Af=Coffee—爸妈不在家— ', spacePascalCase: '担心你D Af=Coffee—爸妈不在家— ', spaceUpperCase: '担心你D AF=COFFEE—爸妈不在家— ', + dotCase: '担心你d.af=coffee—爸妈不在家— ', + dotCamelCase: '担心你d.Af=Coffee—爸妈不在家— ', + dotPascalCase: '担心你D.Af=Coffee—爸妈不在家— ', + dotUpperCase: '担心你D.AF=COFFEE—爸妈不在家— ', lowerCase: '--担心你daf_=coffee—爸妈不在家_— ', upperCase: '--担心你DAF_=COFFEE—爸妈不在家_— ', }, @@ -347,29 +399,33 @@ const testGroups: Array = [ { title: 'Special character with emoji input', input: - '🥰 a-cup/_of Coffee🍻,-_please!. ' + '🥰 a-cup/_of Coffee🍻,-_please.thanks!. ' , eol: [LF, CRLF], transformText: [ - '🥰|a|cup|/|of|coffee|🍻,|please|!. ', + '🥰|a|cup|/|of|coffee|🍻,|please|.|thanks|!. ', ], output: { - camelCase: '🥰aCup/OfCoffee🍻,Please!. ', - pascalCase: '🥰ACup/OfCoffee🍻,Please!. ', - snakeCase: '🥰a_cup/of_coffee🍻,please!. ', - snakeCamelCase: '🥰a_Cup/Of_Coffee🍻,Please!. ', - snakePascalCase: '🥰A_Cup/Of_Coffee🍻,Please!. ', - snakeUpperCase: '🥰A_CUP/OF_COFFEE🍻,PLEASE!. ', - kebabCase: '🥰a-cup/of-coffee🍻,please!. ', - kebabCamelCase: '🥰a-Cup/Of-Coffee🍻,Please!. ', - kebabPascalCase: '🥰A-Cup/Of-Coffee🍻,Please!. ', - kebabUpperCase: '🥰A-CUP/OF-COFFEE🍻,PLEASE!. ', - spaceCase: '🥰a cup/of coffee🍻,please!. ', - spaceCamelCase: '🥰a Cup/Of Coffee🍻,Please!. ', - spacePascalCase: '🥰A Cup/Of Coffee🍻,Please!. ', - spaceUpperCase: '🥰A CUP/OF COFFEE🍻,PLEASE!. ', - lowerCase: '🥰 a-cup/_of coffee🍻,-_please!. ', - upperCase: '🥰 A-CUP/_OF COFFEE🍻,-_PLEASE!. ', + camelCase: '🥰aCup/OfCoffee🍻,Please.Thanks!. ', + pascalCase: '🥰ACup/OfCoffee🍻,Please.Thanks!. ', + snakeCase: '🥰a_cup/of_coffee🍻,please.thanks!. ', + snakeCamelCase: '🥰a_Cup/Of_Coffee🍻,Please.Thanks!. ', + snakePascalCase: '🥰A_Cup/Of_Coffee🍻,Please.Thanks!. ', + snakeUpperCase: '🥰A_CUP/OF_COFFEE🍻,PLEASE.THANKS!. ', + kebabCase: '🥰a-cup/of-coffee🍻,please.thanks!. ', + kebabCamelCase: '🥰a-Cup/Of-Coffee🍻,Please.Thanks!. ', + kebabPascalCase: '🥰A-Cup/Of-Coffee🍻,Please.Thanks!. ', + kebabUpperCase: '🥰A-CUP/OF-COFFEE🍻,PLEASE.THANKS!. ', + spaceCase: '🥰a cup/of coffee🍻,please.thanks!. ', + spaceCamelCase: '🥰a Cup/Of Coffee🍻,Please.Thanks!. ', + spacePascalCase: '🥰A Cup/Of Coffee🍻,Please.Thanks!. ', + spaceUpperCase: '🥰A CUP/OF COFFEE🍻,PLEASE.THANKS!. ', + dotCase: '🥰a.cup/of.coffee🍻,please.thanks!. ', + dotCamelCase: '🥰a.Cup/Of.Coffee🍻,Please.Thanks!. ', + dotPascalCase: '🥰A.Cup/Of.Coffee🍻,Please.Thanks!. ', + dotUpperCase: '🥰A.CUP/OF.COFFEE🍻,PLEASE.THANKS!. ', + lowerCase: '🥰 a-cup/_of coffee🍻,-_please.thanks!. ', + upperCase: '🥰 A-CUP/_OF COFFEE🍻,-_PLEASE.THANKS!. ', }, }, { @@ -396,6 +452,10 @@ const testGroups: Array = [ spaceCamelCase: 'take A Rest😊Ha P Py,😢Tri Ste,Enfadado,驚きました,❤️,笑,😎C Ool,😳Embarrassed', spacePascalCase: 'Take A Rest😊Ha P Py,😢Tri Ste,Enfadado,驚きました,❤️,笑,😎C Ool,😳Embarrassed', spaceUpperCase: 'TAKE A REST😊HA P PY,😢TRI STE,ENFADADO,驚きました,❤️,笑,😎C OOL,😳EMBARRASSED', + dotCase: 'take.a.rest😊ha.p.py,😢tri.ste,enfadado,驚きました,❤️,笑,😎c.ool,😳embarrassed', + dotCamelCase: 'take.A.Rest😊Ha.P.Py,😢Tri.Ste,Enfadado,驚きました,❤️,笑,😎C.Ool,😳Embarrassed', + dotPascalCase: 'Take.A.Rest😊Ha.P.Py,😢Tri.Ste,Enfadado,驚きました,❤️,笑,😎C.Ool,😳Embarrassed', + dotUpperCase: 'TAKE.A.REST😊HA.P.PY,😢TRI.STE,ENFADADO,驚きました,❤️,笑,😎C.OOL,😳EMBARRASSED', lowerCase: 'takearest😊happy,😢triste,enfadado, 驚きました,❤️, 笑, 😎cool, 😳-embarrassed', upperCase: 'TAKEAREST😊HAPPY,😢TRISTE,ENFADADO, 驚きました,❤️, 笑, 😎COOL, 😳-EMBARRASSED', }, @@ -424,6 +484,10 @@ const testGroups: Array = [ spaceCamelCase: ' n H D As+90Usz&* ', spacePascalCase: ' N H D As+90Usz&* ', spaceUpperCase: ' N H D AS+90USZ&* ', + dotCase: ' n.h.d.as+90usz&* ', + dotCamelCase: ' n.H.D.As+90Usz&* ', + dotPascalCase: ' N.H.D.As+90Usz&* ', + dotUpperCase: ' N.H.D.AS+90USZ&* ', lowerCase: ' nhdas--+90-usz&* ', upperCase: ' NHDAS--+90-USZ&* ', }, @@ -452,6 +516,10 @@ const testGroups: Array = [ spaceCamelCase: 'fsdi Sdacsaf+Desd', spacePascalCase: 'Fsdi Sdacsaf+Desd', spaceUpperCase: 'FSDI SDACSAF+DESD', + dotCase: 'fsdi.sdacsaf+desd', + dotCamelCase: 'fsdi.Sdacsaf+Desd', + dotPascalCase: 'Fsdi.Sdacsaf+Desd', + dotUpperCase: 'FSDI.SDACSAF+DESD', lowerCase: 'fsdi_sdacsaf+desd', upperCase: 'FSDI_SDACSAF+DESD', }, @@ -490,6 +558,10 @@ const testGroups: Array = [ spaceCamelCase: 'foo Bar', spacePascalCase: 'Foo Bar', spaceUpperCase: 'FOO BAR', + dotCase: 'foo.bar', + dotCamelCase: 'foo.Bar', + dotPascalCase: 'Foo.Bar', + dotUpperCase: 'FOO.BAR', // lowerCase: 'foo--bar', // upperCase: 'FOO--BAR', }, @@ -523,6 +595,10 @@ const testGroups: Array = [ spaceCamelCase: 'test Case', spacePascalCase: 'Test Case', spaceUpperCase: 'TEST CASE', + dotCase: 'test.case', + dotCamelCase: 'test.Case', + dotPascalCase: 'Test.Case', + dotUpperCase: 'TEST.CASE', // lowerCase: 'test case', // upperCase: 'TEST CASE', }, @@ -553,6 +629,10 @@ const testGroups: Array = [ spaceCamelCase: 'apple', spacePascalCase: 'Apple', spaceUpperCase: 'APPLE', + dotCase: 'apple', + dotCamelCase: 'apple', + dotPascalCase: 'Apple', + dotUpperCase: 'APPLE', lowerCase: 'apple', upperCase: 'APPLE', }, @@ -581,6 +661,10 @@ const testGroups: Array = [ spaceCamelCase: 'pine Apple', spacePascalCase: 'Pine Apple', spaceUpperCase: 'PINE APPLE', + dotCase: 'pine.apple', + dotCamelCase: 'pine.Apple', + dotPascalCase: 'Pine.Apple', + dotUpperCase: 'PINE.APPLE', lowerCase: 'pineapple', upperCase: 'PINEAPPLE', }, @@ -618,10 +702,84 @@ const testGroups: Array = [ spaceCamelCase: 'have A Nice Day!', spacePascalCase: 'Have A Nice Day!', spaceUpperCase: 'HAVE A NICE DAY!', + dotCase: 'have.a.nice.day!', + dotCamelCase: 'have.A.Nice.Day!', + dotPascalCase: 'Have.A.Nice.Day!', + dotUpperCase: 'HAVE.A.NICE.DAY!', // lowerCase: 'have a nice day!', // upperCase: 'HAVE A NICE DAY!', }, }, + { + title: 'Normal input (Dot input: Every day of your life)', + input: '.Every day of your life.. it is..important..to take.the.time to “smell the roses” — to appreciate the experiences that lead to happiness. This is part of being truly happy.', + eol: [LF, CRLF], + transformText: [ + '.|every|day|of|your|life|..|it|is|..|important|..|to|take|.|the|.|time|to|“|smell|the|roses|”|—|to|appreciate|the|experiences|that|lead|to|happiness|.|this|is|part|of|being|truly|happy|.', + ], + output: { + camelCase: + '.everyDayOfYourLife..ItIs..Important..ToTake.The.TimeTo“SmellTheRoses”—ToAppreciateTheExperiencesThatLeadToHappiness.ThisIsPartOfBeingTrulyHappy.' + , + pascalCase: + '.EveryDayOfYourLife..ItIs..Important..ToTake.The.TimeTo“SmellTheRoses”—ToAppreciateTheExperiencesThatLeadToHappiness.ThisIsPartOfBeingTrulyHappy.' + , + snakeCase: + '.every_day_of_your_life..it_is..important..to_take.the.time_to“smell_the_roses”—to_appreciate_the_experiences_that_lead_to_happiness.this_is_part_of_being_truly_happy.' + , + snakeCamelCase: + '.every_Day_Of_Your_Life..It_Is..Important..To_Take.The.Time_To“Smell_The_Roses”—To_Appreciate_The_Experiences_That_Lead_To_Happiness.This_Is_Part_Of_Being_Truly_Happy.' + , + snakePascalCase: + '.Every_Day_Of_Your_Life..It_Is..Important..To_Take.The.Time_To“Smell_The_Roses”—To_Appreciate_The_Experiences_That_Lead_To_Happiness.This_Is_Part_Of_Being_Truly_Happy.' + , + snakeUpperCase: + '.EVERY_DAY_OF_YOUR_LIFE..IT_IS..IMPORTANT..TO_TAKE.THE.TIME_TO“SMELL_THE_ROSES”—TO_APPRECIATE_THE_EXPERIENCES_THAT_LEAD_TO_HAPPINESS.THIS_IS_PART_OF_BEING_TRULY_HAPPY.' + , + kebabCase: + '.every-day-of-your-life..it-is..important..to-take.the.time-to“smell-the-roses”—to-appreciate-the-experiences-that-lead-to-happiness.this-is-part-of-being-truly-happy.' + , + kebabCamelCase: + '.every-Day-Of-Your-Life..It-Is..Important..To-Take.The.Time-To“Smell-The-Roses”—To-Appreciate-The-Experiences-That-Lead-To-Happiness.This-Is-Part-Of-Being-Truly-Happy.' + , + kebabPascalCase: + '.Every-Day-Of-Your-Life..It-Is..Important..To-Take.The.Time-To“Smell-The-Roses”—To-Appreciate-The-Experiences-That-Lead-To-Happiness.This-Is-Part-Of-Being-Truly-Happy.' + , + kebabUpperCase: + '.EVERY-DAY-OF-YOUR-LIFE..IT-IS..IMPORTANT..TO-TAKE.THE.TIME-TO“SMELL-THE-ROSES”—TO-APPRECIATE-THE-EXPERIENCES-THAT-LEAD-TO-HAPPINESS.THIS-IS-PART-OF-BEING-TRULY-HAPPY.' + , + spaceCase: + '.every day of your life..it is..important..to take.the.time to“smell the roses”—to appreciate the experiences that lead to happiness.this is part of being truly happy.' + , + spaceCamelCase: + '.every Day Of Your Life..It Is..Important..To Take.The.Time To“Smell The Roses”—To Appreciate The Experiences That Lead To Happiness.This Is Part Of Being Truly Happy.' + , + spacePascalCase: + '.Every Day Of Your Life..It Is..Important..To Take.The.Time To“Smell The Roses”—To Appreciate The Experiences That Lead To Happiness.This Is Part Of Being Truly Happy.' + , + spaceUpperCase: + '.EVERY DAY OF YOUR LIFE..IT IS..IMPORTANT..TO TAKE.THE.TIME TO“SMELL THE ROSES”—TO APPRECIATE THE EXPERIENCES THAT LEAD TO HAPPINESS.THIS IS PART OF BEING TRULY HAPPY.' + , + dotCase: + '.every.day.of.your.life..it.is..important..to.take.the.time.to“smell.the.roses”—to.appreciate.the.experiences.that.lead.to.happiness.this.is.part.of.being.truly.happy.' + , + dotCamelCase: + '.every.Day.Of.Your.Life..It.Is..Important..To.Take.The.Time.To“Smell.The.Roses”—To.Appreciate.The.Experiences.That.Lead.To.Happiness.This.Is.Part.Of.Being.Truly.Happy.' + , + dotPascalCase: + '.Every.Day.Of.Your.Life..It.Is..Important..To.Take.The.Time.To“Smell.The.Roses”—To.Appreciate.The.Experiences.That.Lead.To.Happiness.This.Is.Part.Of.Being.Truly.Happy.' + , + dotUpperCase: + '.EVERY.DAY.OF.YOUR.LIFE..IT.IS..IMPORTANT..TO.TAKE.THE.TIME.TO“SMELL.THE.ROSES”—TO.APPRECIATE.THE.EXPERIENCES.THAT.LEAD.TO.HAPPINESS.THIS.IS.PART.OF.BEING.TRULY.HAPPY.' + , + lowerCase: + '.every day of your life.. it is..important..to take.the.time to “smell the roses” — to appreciate the experiences that lead to happiness. this is part of being truly happy.' + , + upperCase: + '.EVERY DAY OF YOUR LIFE.. IT IS..IMPORTANT..TO TAKE.THE.TIME TO “SMELL THE ROSES” — TO APPRECIATE THE EXPERIENCES THAT LEAD TO HAPPINESS. THIS IS PART OF BEING TRULY HAPPY.' + , + }, + }, { title: 'Normal input (a-nice-day!)', input: [ @@ -653,6 +811,10 @@ const testGroups: Array = [ spaceCamelCase: ' a Nice Day! ', spacePascalCase: ' A Nice Day! ', spaceUpperCase: ' A NICE DAY! ', + dotCase: ' a.nice.day! ', + dotCamelCase: ' a.Nice.Day! ', + dotPascalCase: ' A.Nice.Day! ', + dotUpperCase: ' A.NICE.DAY! ', // lowerCase: ' a nice day! ', // upperCase: ' A NICE DAY! ', }, @@ -682,6 +844,10 @@ const testGroups: Array = [ spaceCamelCase: ' a Nice Day', spacePascalCase: ' A Nice Day', spaceUpperCase: ' A NICE DAY', + dotCase: ' a.nice.day', + dotCamelCase: ' a.Nice.Day', + dotPascalCase: ' A.Nice.Day', + dotUpperCase: ' A.NICE.DAY', // lowerCase: ' a nice-day-', // upperCase: ' A NICE-DAY-', }, @@ -710,6 +876,10 @@ const testGroups: Array = [ spaceCamelCase: 'tom Likes Eat Ice Cream.', spacePascalCase: 'Tom Likes Eat Ice Cream.', spaceUpperCase: 'TOM LIKES EAT ICE CREAM.', + dotCase: 'tom.likes.eat.ice.cream.', + dotCamelCase: 'tom.Likes.Eat.Ice.Cream.', + dotPascalCase: 'Tom.Likes.Eat.Ice.Cream.', + dotUpperCase: 'TOM.LIKES.EAT.ICE.CREAM.', lowerCase: 'tomlikes eat icecream.', upperCase: 'TOMLIKES EAT ICECREAM.', }, @@ -739,6 +909,10 @@ const testGroups: Array = [ spaceCamelCase: ' apple2Tree ', spacePascalCase: ' Apple2Tree ', spaceUpperCase: ' APPLE2TREE ', + dotCase: ' apple2tree ', + dotCamelCase: ' apple2Tree ', + dotPascalCase: ' Apple2Tree ', + dotUpperCase: ' APPLE2TREE ', // lowerCase: ' apple2-tree ', // upperCase: ' APPLE2-TREE ', }, @@ -767,6 +941,10 @@ const testGroups: Array = [ spaceCamelCase: ' julius Caesar,William Shakespeare,Albert Einstein,Marie Curie,Wolfgang Amadeus Mozart,Vincent Van Gogh. ', spacePascalCase: ' Julius Caesar,William Shakespeare,Albert Einstein,Marie Curie,Wolfgang Amadeus Mozart,Vincent Van Gogh. ', spaceUpperCase: ' JULIUS CAESAR,WILLIAM SHAKESPEARE,ALBERT EINSTEIN,MARIE CURIE,WOLFGANG AMADEUS MOZART,VINCENT VAN GOGH. ', + dotCase: ' julius.caesar,william.shakespeare,albert.einstein,marie.curie,wolfgang.amadeus.mozart,vincent.van.gogh. ', + dotCamelCase: ' julius.Caesar,William.Shakespeare,Albert.Einstein,Marie.Curie,Wolfgang.Amadeus.Mozart,Vincent.Van.Gogh. ', + dotPascalCase: ' Julius.Caesar,William.Shakespeare,Albert.Einstein,Marie.Curie,Wolfgang.Amadeus.Mozart,Vincent.Van.Gogh. ', + dotUpperCase: ' JULIUS.CAESAR,WILLIAM.SHAKESPEARE,ALBERT.EINSTEIN,MARIE.CURIE,WOLFGANG.AMADEUS.MOZART,VINCENT.VAN.GOGH. ', lowerCase: ' julius_caesar, william_shakespeare, albert_einstein, marie_curie, wolfgangamadeusmozart, vincent-van-gogh. ', upperCase: ' JULIUS_CAESAR, WILLIAM_SHAKESPEARE, ALBERT_EINSTEIN, MARIE_CURIE, WOLFGANGAMADEUSMOZART, VINCENT-VAN-GOGH. ', }, @@ -839,6 +1017,22 @@ const testGroups: Array = [ ' "YOU"(OR"YOUR")SHALL MEAN AN INDIVIDUAL OR LEGAL ENTITY\n' + ' EXERCISING PERMISSIONS GRANTED BY THIS LICENSE.' , + dotCase: + ' "you"(or"your")shall.mean.an.individual.or.legal.entity\n' + + ' exercising.permissions.granted.by.this.license.' + , + dotCamelCase: + ' "You&Quot;(Or&Quot;Your&Quot;)Shall.Mean.An.Individual.Or.Legal.Entity\n' + + ' exercising.Permissions.Granted.By.This.License.' + , + dotPascalCase: + ' &Quot;You&Quot;(Or&Quot;Your&Quot;)Shall.Mean.An.Individual.Or.Legal.Entity\n' + + ' Exercising.Permissions.Granted.By.This.License.' + , + dotUpperCase: + ' "YOU"(OR"YOUR")SHALL.MEAN.AN.INDIVIDUAL.OR.LEGAL.ENTITY\n' + + ' EXERCISING.PERMISSIONS.GRANTED.BY.THIS.LICENSE.' + , lowerCase: ' "you" (or "your") shall mean an individual or legal entity\n' + ' exercising permissions granted by this license.' @@ -888,6 +1082,10 @@ const testGroups: Array = [ // spaceCamelCase: '', // spacePascalCase: '', // spaceUpperCase: '', + // dotCase: '', + // dotCamelCase: '', + // dotPascalCase: '', + // dotUpperCase: '', // lowerCase: '', // upperCase: '', // }, diff --git a/src/type-definition/SupportCaseType.ts b/src/type-definition/SupportCaseType.ts index bc3348b..e4b2418 100644 --- a/src/type-definition/SupportCaseType.ts +++ b/src/type-definition/SupportCaseType.ts @@ -158,6 +158,46 @@ export enum SupportCase { */ SPACE_UPPER_CASE, + /** + * 点分隔命名 + * Dot Case / Spinal Case + * e.g. foo bar + * + * @alias: dotCase / DotCase / dot case / dot_case / DOT_CASE + * @since 2024-06-13 + */ + DOT_CASE, + + /** + * 点分隔 + 小驼峰(驼峰)命名 + * Dot Camel Case + * e.g. foo Bar + * + * @alias: dotCamelCase / DotCamelCase / dot camel case / dot_camel_case / DOT_CAMEL_CASE + * @since 2024-06-13 + */ + DOT_CAMEL_CASE, + + /** + * 点分隔 + 大驼峰(帕斯卡)命名 + * Dot Pascal Case + * e.g. Foo Bar + * + * @alias: dotPascalCase / DotPascalCase / dot pascal case / dot_pascal_case / DOT_PASCAL_CASE + * @since 2024-06-13 + */ + DOT_PASCAL_CASE, + + /** + * 点分隔 + 全大写命名 + * Dot Upper Case + * e.g. FOO BAR + * + * @alias: dotUpperCase / DotUpperCase / dot upper case / dot_upper_case / DOT_UPPER_CASE + * @since 2024-06-13 + */ + DOT_UPPER_CASE, + /** * 全小写 * Lower Case @@ -215,6 +255,13 @@ const keyword = { 'KongGe', 'kg', ], + dot: [ + '点', '.', + 'Dot Case', + 'dc', + 'Dian', + 'd', + ], upper: [ '全大写', '大写', 'Upper Case', @@ -253,6 +300,11 @@ export const commands: Array<{ command: string; targetCase: SupportCase }> = [ { command: 'variable-conversion.toSpacePascalCase', targetCase: SupportCase.SPACE_PASCAL_CASE }, { command: 'variable-conversion.toSpaceCamelCase', targetCase: SupportCase.SPACE_CAMEL_CASE }, + { command: 'variable-conversion.toDotCase', targetCase: SupportCase.DOT_CASE }, + { command: 'variable-conversion.toDotUpperCase', targetCase: SupportCase.DOT_UPPER_CASE }, + { command: 'variable-conversion.toDotPascalCase', targetCase: SupportCase.DOT_PASCAL_CASE }, + { command: 'variable-conversion.toDotCamelCase', targetCase: SupportCase.DOT_CAMEL_CASE }, + { command: 'variable-conversion.toLowerCase', targetCase: SupportCase.LOWER_CASE }, { command: 'variable-conversion.toUpperCase', targetCase: SupportCase.UPPER_CASE }, ]; @@ -346,6 +398,30 @@ export const quickPickSupportCases = [ shortName: '脊柱大写', keyword: [...keyword.space, ...keyword.upper], }, + { + type: SupportCase.DOT_CASE, + name: '点分隔命名', + shortName: '脊柱', + keyword: [...keyword.dot, ...keyword.lower], + }, + { + type: SupportCase.DOT_CAMEL_CASE, + name: '点分隔 + 小驼峰(驼峰)命名', + shortName: '脊柱驼峰', + keyword: [...keyword.dot, ...keyword.camel], + }, + { + type: SupportCase.DOT_PASCAL_CASE, + name: '点分隔 + 大驼峰(帕斯卡)命名', + shortName: '脊柱帕斯卡', + keyword: [...keyword.dot, ...keyword.pascal], + }, + { + type: SupportCase.DOT_UPPER_CASE, + name: '点分隔 + 全大写命名', + shortName: '脊柱大写', + keyword: [...keyword.dot, ...keyword.upper], + }, { type: SupportCase.LOWER_CASE, name: '全小写', @@ -370,18 +446,22 @@ export const cyclicConvertCaseOrder = [ SupportCase.PASCAL_CASE, SupportCase.KEBAB_CASE, SupportCase.SPACE_CASE, + SupportCase.DOT_CASE, SupportCase.SNAKE_UPPER_CASE, SupportCase.KEBAB_UPPER_CASE, SupportCase.SPACE_UPPER_CASE, + SupportCase.DOT_UPPER_CASE, SupportCase.SNAKE_PASCAL_CASE, SupportCase.KEBAB_PASCAL_CASE, SupportCase.SPACE_PASCAL_CASE, + SupportCase.DOT_PASCAL_CASE, SupportCase.SNAKE_CAMEL_CASE, SupportCase.KEBAB_CAMEL_CASE, SupportCase.SPACE_CAMEL_CASE, + SupportCase.DOT_CAMEL_CASE, SupportCase.LOWER_CASE, SupportCase.UPPER_CASE, diff --git a/src/type-definition/TestCaseType.ts b/src/type-definition/TestCaseType.ts index 610257d..4c99d87 100644 --- a/src/type-definition/TestCaseType.ts +++ b/src/type-definition/TestCaseType.ts @@ -30,6 +30,11 @@ export type TestCase = { spacePascalCase: string spaceUpperCase: string + dotCase: string + dotCamelCase: string + dotPascalCase: string + dotUpperCase: string + lowerCase?: string upperCase?: string }