del-repos
Version:
A command-line tool for bulk deleting GitHub or Gitee repositories
24 lines (23 loc) • 716 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.reposType = exports.extractPath = void 0;
const extractPath = (input) => {
const startIndex = input.indexOf('/') + 1;
let result = input.substring(startIndex);
result = encodeURIComponent(result);
const prefix = '%20%1B%5D8%3B';
const prefIndex = result.indexOf(prefix);
if (prefIndex !== -1) {
return result.substring(0, prefIndex);
}
return result;
};
exports.extractPath = extractPath;
const reposType = (type) => {
const map = new Map([
['o', 'owner'],
['a', 'all'],
]);
return map.get(type) || 'all';
};
exports.reposType = reposType;