Skip to content

Commit

Permalink
fix: correct pascalCase type
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Jan 14, 2022
1 parent ad91234 commit cf66443
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/pascalCase.ts
@@ -1,6 +1,8 @@
import type { PascalCase } from "type-fest";

export const pascalCase = <Input>(input: string): PascalCase<Input> => {
export const pascalCase = <Input extends string>(
input: Input,
): PascalCase<Input> => {
const camelCased = input.replace(/(?:-|_)(\w)/g, (_, c) => {
return c ? c.toUpperCase() : "";
});
Expand Down

0 comments on commit cf66443

Please sign in to comment.