Skip to content

Commit

Permalink
简单修理。
Browse files Browse the repository at this point in the history
  • Loading branch information
kalxd committed Aug 29, 2024
1 parent 213c9f1 commit 395c59c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ type ToCamelCase<T extends string> = T extends `_${infer Rest}`
? `${First}${Capitalize<ToCamelCase<Rest>>}`
: T;

const capitalize = (input: string): string => {
const capitalize = (input: string): Capitalize<string> => {
if (input === "") {
return input;
}

const f = input[0];
const rest = input.substring(1);
return f.toUpperCase() + rest;
return f.toUpperCase() + rest as Capitalize<string>;
};

const toCamelCase = <T extends string>(input: T): ToCamelCase<T> => {
Expand Down

0 comments on commit 395c59c

Please sign in to comment.