Files
simple-qr/shared/utils/formatting.ts
2026-02-21 16:22:51 +01:00

11 lines
365 B
TypeScript

export const capitalize = (str: string) =>
str.charAt(0).toUpperCase() + str.slice(1);
export const upperCase = (str: string) => str.toUpperCase();
export const arrayToUnion = (array: string[] | readonly string[]) =>
array.map((x) => `"${x}"`).join(" | ");
export const unreadonly = <T extends string>(arr: readonly T[]): string[] =>
[...arr] as string[];