Vinyl
    Preparing search index...

    Function resolveUrl

    • Resolves a relative URI against a base URL using string manipulation, avoiding the overhead of constructing URL objects.

      Handles the same cases as new URL(relative, base):

      • Absolute URIs (with scheme) are returned as-is.
      • Protocol-relative URIs (//host/path) inherit the base scheme.
      • Absolute paths (/path) replace the base path.
      • Relative paths are resolved against the base directory.

      Parameters

      • relative: string

        The relative (or absolute) URI to resolve.

      • base: string

        The base URL string to resolve against.

      Returns string

      A resolved absolute URL string.