Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NodeSharedCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Shared
NodeSharedCode
Compare revisions
0328c67fd0cade4b51fbf82afc7a07a7d16abe5d to f20c94b884f7ab76936b059b712274a35fcc6318
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
dojo_project/projects/shared/nodesharedcode
Select target project
No results found
f20c94b884f7ab76936b059b712274a35fcc6318
Select Git revision
Branches
jw_sonar
jw_sonar_backup
main
move-to-esm-only
open_tool_for_self_hosting
v5.0
Tags
v4.1
v4.2
8 results
Swap
Target
dojo_project/projects/shared/nodesharedcode
Select target project
dojo_project/projects/shared/nodesharedcode
1 result
0328c67fd0cade4b51fbf82afc7a07a7d16abe5d
Select Git revision
Branches
jw_sonar
jw_sonar_backup
main
move-to-esm-only
open_tool_for_self_hosting
v5.0
Tags
v4.1
v4.2
8 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Singletons => Change method to make singleton class
· f20c94b8
michael.minelli
authored
2 years ago
f20c94b8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/SharedConfig.ts
+2
-12
2 additions, 12 deletions
config/SharedConfig.ts
helpers/Toolbox.ts
+1
-13
1 addition, 13 deletions
helpers/Toolbox.ts
with
3 additions
and
25 deletions
config/SharedConfig.ts
View file @
f20c94b8
class
SharedConfig
{
private
static
_instance
:
SharedConfig
;
public
readonly
production
:
boolean
;
public
readonly
logsFolder
:
string
;
private
constructor
()
{
constructor
()
{
this
.
production
=
process
.
env
.
NODE_ENV
===
'
production
'
;
this
.
logsFolder
=
process
.
env
.
LOGS_FOLDER
||
''
;
}
public
static
get
instance
():
SharedConfig
{
if
(
!
SharedConfig
.
_instance
)
{
SharedConfig
.
_instance
=
new
SharedConfig
();
}
return
SharedConfig
.
_instance
;
}
}
export
default
SharedConfig
.
instance
;
export
default
new
SharedConfig
()
;
This diff is collapsed.
Click to expand it.
helpers/Toolbox.ts
View file @
f20c94b8
class
Toolbox
{
private
static
_instance
:
Toolbox
;
private
constructor
()
{
}
public
static
get
instance
():
Toolbox
{
if
(
!
Toolbox
.
_instance
)
{
Toolbox
.
_instance
=
new
Toolbox
();
}
return
Toolbox
.
_instance
;
}
public
urlToPath
(
url
:
string
):
string
{
return
url
.
replace
(
/^
([
a-z
]{3,5}
:
\/{2})?[
a-z.@
]
+
(
:
[
0-9
]{1,5})?
.
(
.*
)
/
,
'
$3
'
).
replace
(
'
.git
'
,
''
);
}
}
export
default
Toolbox
.
instance
;
export
default
new
Toolbox
()
;
This diff is collapsed.
Click to expand it.