Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
24c324c5
Commit
24c324c5
authored
7 years ago
by
Steven Hargrove
Committed by
Rhys Arkins
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor: initPlatform
parent
7b0ae535
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/platform/index.js
+14
-11
14 additions, 11 deletions
lib/platform/index.js
with
14 additions
and
11 deletions
lib/platform/index.js
+
14
−
11
View file @
24c324c5
const
github
=
require
(
'
./github
'
);
const
gitlab
=
require
(
'
./gitlab
'
);
const
vsts
=
require
(
'
./vsts
'
);
/* eslint-disable global-require */
const
platforms
=
new
Map
([
[
'
github
'
,
require
(
'
./github
'
)],
[
'
gitlab
'
,
require
(
'
./gitlab
'
)],
[
'
vsts
'
,
require
(
'
./vsts
'
)],
]);
/* eslint-enable global-require */
function
initPlatform
(
val
)
{
if
(
val
===
'
github
'
)
{
global
.
platform
=
github
;
}
else
if
(
val
===
'
gitlab
'
)
{
global
.
platform
=
gitlab
;
}
else
if
(
val
===
'
vsts
'
)
{
global
.
platform
=
vsts
;
function
getPlatformApi
(
platform
)
{
return
platforms
.
get
(
platform
);
}
function
initPlatform
(
platform
)
{
global
.
platform
=
getPlatformApi
(
platform
);
}
module
.
exports
=
{
initPlatform
,
getPlatformApi
,
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment