Strip the leading @ (user) or + (team) sigil from a URL slug.
The function is exposed via three overload signatures so the return type narrows precisely to what the caller passed in:
"@user" (user-sigil literal) → narrows to the bare slug literal
"user". Useful inside fetchTiltifyUser("@" + slug) style
call sites that want to round-trip a literal slug through the
helper without losing type information."+team" (team-sigil literal) → narrows to the bare slug
literal "team".string / null / undefined → passes through verbatim. The
T generic is preserved so e.g. stripSigil(null) is typed
null instead of widening to string | null | undefined.The runtime implementation is a single 4-line function; the overloads exist purely for ergonomics at the call site.
Team-sigil overload — see the main stripSigil docblock.
A literal slug prefixed with + (the Tiltify team
sigil). The return type is narrowed to the bare slug.
Generic / fallthrough overload — see the main stripSigil docblock.
One of string, null, or undefined. The exact
type of slug flows through to the return type unchanged so
nullish inputs stay typed as null / undefined instead of
widening to the full union.
Runtime implementation of stripSigil. Not selected by overload resolution at the call site; see the overload signatures above for the user-facing contract.