Proxy viewer extraction: response viewers into packages/ui (#754)

This commit is contained in:
Gregory Schier authored and GitHub committed 2026-10-14 21:32:19 -07:00
1 parent b5508e6bb1
commit b6c1f700f1
137 files changed
+3498 -2890

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import { customAlphabet } from "nanoid";
const nanoid = customAlphabet("023456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ", 10);
export function generateId(): string {
return nanoid();
}
+20
View File
@@ -0,0 +1,20 @@
export function pluralize(word: string, count: number): string {
if (count === 1) {
return word;
}
return `${word}s`;
}
export function pluralizeCount(
word: string,
count: number,
opt: { omitSingle?: boolean; noneWord?: string } = {},
): string {
if (opt.omitSingle && count === 1) {
return word;
}
if (opt.noneWord && count === 0) {
return opt.noneWord;
}
return `${count} ${pluralize(word, count)}`;
}