Skip to main content
Version: Next

replaceGithubUrlType()

Home > @backstage/integration > replaceGithubUrlType

Takes a GitHub URL and replaces the type part (blob, tree etc).

Signature:

function replaceGithubUrlType(url: string, type: 'blob' | 'tree' | 'edit'): string;

Parameters

ParameterTypeDescription
urlstringThe original URL
type'blob' | 'tree' | 'edit'The desired type, e.g. "blob"

Returns:

string