Skip to content
Snippets Groups Projects
Commit 24c324c5 authored by Steven Hargrove's avatar Steven Hargrove Committed by Rhys Arkins
Browse files

refactor: initPlatform

parent 7b0ae535
No related branches found
No related tags found
No related merge requests found
const github = require('./github'); /* eslint-disable global-require */
const gitlab = require('./gitlab'); const platforms = new Map([
const vsts = require('./vsts'); ['github', require('./github')],
['gitlab', require('./gitlab')],
['vsts', require('./vsts')],
]);
/* eslint-enable global-require */
function initPlatform(val) { function getPlatformApi(platform) {
if (val === 'github') { return platforms.get(platform);
global.platform = github; }
} else if (val === 'gitlab') {
global.platform = gitlab; function initPlatform(platform) {
} else if (val === 'vsts') { global.platform = getPlatformApi(platform);
global.platform = vsts;
}
} }
module.exports = { module.exports = {
initPlatform, initPlatform,
getPlatformApi,
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment