ts-playground

TypeScript Playground

View on GitHub

Home > ts-playground > normalizeBranchName

normalizeBranchName() function

normalize branch name

Signature:

export declare function normalizeBranchName(branch: string): string;

Parameters

Parameter Type Description
branch string branch name

Returns:

string

normalized branch name

Example

const branch = normalizeBranchName(`refs/heads/master`);

expect(branch).toEqual('master');