Skip to content

Commit

Permalink
fix: properName and cleanEmail so that the result is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchal committed Dec 20, 2021
1 parent 2d09f4e commit 00701f9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ export type MapKeys<A, B> = {
[K in keyof A as A[K] extends string ? A[K] : never]: K extends keyof B ? B[K] : never;
};

export const properName = coerce(string, spaces, trim, quotes, proper, not(length(0)), limit(100));
export const properName = coerce(
string,
spaces,
trim,
quotes,
proper,
not(length(0)),
limit(100),
string,
);

export const cleanEmail = coerce(string, email, limit(100));
export const cleanEmail = coerce(string, email, limit(100), string);

export const cleanPhone = coerce(string, prettyPhone);

Expand Down

0 comments on commit 00701f9

Please sign in to comment.