Files
t5de-hub/apps/web/lib/imvu.ts
T
dhkatzandClaude Opus 5.5 64b9658bad
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 1m19s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped
feat: recorded import grants, unclaimed creators and claiming
Admins record consent for IMVU creators without an account; their products
belong to a placeholder (imvu_<ID>) until they link the account and claim
them. Proof by a tagline code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 11:12:26 -08:00

14 lines
558 B
TypeScript

// IMVU product IDs in what people type or paste.
/** IMVU product IDs: numbers, or shop links (`products_id=123`, `product-123`), separated by spaces, commas or lines. */
export function productIDs(text: string): number[] | undefined {
const out = new Set<number>();
for (const part of text.split(/[\s,]+/).filter(Boolean)) {
const m = part.match(/(?:products_id=|product-)(\d+)/) ?? part.match(/^(\d+)$/);
const n = m ? Number(m[1]) : NaN;
if (!Number.isSafeInteger(n) || n <= 0) return undefined;
out.add(n);
}
return [...out];
}