diff --git a/azure-pipelines/ci.yml b/azure-pipelines/ci.yml index b34487e..a86b31c 100644 --- a/azure-pipelines/ci.yml +++ b/azure-pipelines/ci.yml @@ -39,6 +39,9 @@ jobs: - script: 'npx @microsoft/rush sync-versions && npx @microsoft/rush update && npx @microsoft/rush rebuild' displayName: 'npm build' + - script: 'npm test' + displayName: 'npm test' + - script: 'npx @microsoft/rush publish --publish --pack --include-all --tag latest' displayName: 'npm pack' diff --git a/src/helper.ts b/src/helper.ts index 9895298..f0be78f 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -168,7 +168,7 @@ export class Helper { return; } - let up1 = (n: string) => n.length == 1 ? n.toUpperCase() : n[0].toUpperCase().concat(n.substr(1).toLowerCase()); + let up1 = (n: string) => Helper.isEmptyString(n) ? n : n.length == 1 ? n.toUpperCase() : n[0].toUpperCase().concat(n.substr(1).toLowerCase()); let op = {}; op[CliConst.NamingStyle.camel] = { wording: (v: string, i: number) => i === 0 ? v.toLowerCase() : up1(v),