@playlive/fundraiser-data
    Preparing search index...

    Function stripSigil

    Runtime implementation of stripSigil. Not selected by overload resolution at the call site; see the overload signatures above for the user-facing contract.

    • 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.

      Type Parameters

      • S extends string

      Parameters

      • slug: `@${S}`

      Returns S

      stripSigil("@kbb");       // → "kbb"   (typed as "kbb")
      stripSigil("+playlive"); // → "playlive" (typed as "playlive")
      stripSigil("no-sigil"); // → "no-sigil"
      stripSigil(null); // → null (typed as null)
      stripSigil(undefined); // → undefined
    • Team-sigil overload — see the main stripSigil docblock.

      Type Parameters

      • S extends string

      Parameters

      • slug: `+${S}`

        A literal slug prefixed with + (the Tiltify team sigil). The return type is narrowed to the bare slug.

      Returns S

    • Generic / fallthrough overload — see the main stripSigil docblock.

      Type Parameters

      • T extends string | null | undefined

        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.

      Parameters

      • slug: T

      Returns T