repository-provider
Version:
abstract interface to git repository providers like github, bitbucket and gitlab
35 lines (34 loc) • 1.52 kB
text/typescript
/**
* Convert scalar into an array.
* The value undefined will be represented as an empty array.
* @param {Array|any} value
* @return {Array} value encapsulated in an array
*/
export function asArray(value: any[] | any): any[];
/**
* Strip repository base name away.
* A URL auth component will be removed to.
* @param {string|undefined} name
* @param {string[]} repositoryBases all possible bases
* @param {function(string):void} [whenFound] to be called with the found base name
* @return {string|undefined} name without base
*/
export function stripBaseName(name: string | undefined, repositoryBases: string[], whenFound?: (arg0: string) => void): string | undefined;
/**
* Loops over names and executes stripBaseName.
* @param {string[]|string|undefined} names
* @param {string[]} repositoryBases all possible bases
* @param {function(string):void} [whenFound] to be called with the found base name
* @return {string[]|string|undefined} names without base
*/
export function stripBaseNames(names: string[] | string | undefined, repositoryBases: string[], whenFound?: (arg0: string) => void): string[] | string | undefined;
/**
* Find a new branch name for a given pattern.
* '*' will be replaced by a number.
* 'something/*' will get to something/1 something/2 ...
* @param {Repository} repository
* @param {string} pattern
* @return {Promise<string>}
*/
export function generateBranchName(repository: Repository, pattern: string): Promise<string>;
import { Repository } from "./repository.mjs";