Created helper curried function to compare two values

This commit is contained in:
Alejandro Celaya
2022-12-05 17:29:59 +01:00
parent 1654784471
commit 5d712d7d78
2 changed files with 10 additions and 7 deletions

View File

@@ -24,3 +24,5 @@ export type OptionalString = Optional<string>;
export const nonEmptyValueOrNull = <T>(value: T): T | null => (isEmpty(value) ? null : value);
export const capitalize = <T extends string>(value: T): string => `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
export const equals = (value: any) => (otherValue: any) => value === otherValue;