Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
e74145b2
Commit
e74145b2
authored
Dec 04, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update createNonClashingName
parent
ee41116c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
helper.js
src/lib/helper.js
+10
-4
No files found.
src/lib/helper.js
View file @
e74145b2
...
@@ -9,13 +9,19 @@ module.exports = {
...
@@ -9,13 +9,19 @@ module.exports = {
var
len
=
data
.
length
var
len
=
data
.
length
return
data
.
slice
(
0
,
5
)
+
'...'
+
data
.
slice
(
len
-
5
,
len
)
return
data
.
slice
(
0
,
5
)
+
'...'
+
data
.
slice
(
len
-
5
,
len
)
},
},
createNonClashingName
(
path
,
fileProvider
)
{
createNonClashingName
(
name
,
fileProvider
)
{
var
counter
=
''
var
counter
=
''
if
(
path
.
endsWith
(
'.sol'
))
path
=
path
.
substring
(
0
,
path
.
lastIndexOf
(
'.sol'
))
var
ext
=
'sol'
while
(
fileProvider
.
exists
(
path
+
counter
+
'.sol'
))
{
var
reg
=
/
(
.*
)\.([^
.
]
+
)
/g
var
split
=
reg
.
exec
(
name
)
if
(
split
)
{
name
=
split
[
1
]
ext
=
split
[
2
]
}
while
(
fileProvider
.
exists
(
name
+
counter
+
'.'
+
ext
))
{
counter
=
(
counter
|
0
)
+
1
counter
=
(
counter
|
0
)
+
1
}
}
return
path
+
counter
+
'.sol'
return
name
+
counter
+
'.'
+
ext
},
},
checkSpecialChars
(
name
)
{
checkSpecialChars
(
name
)
{
return
name
.
match
(
/
[/
:*?"<>
\\
'|
]
/
)
!=
null
return
name
.
match
(
/
[/
:*?"<>
\\
'|
]
/
)
!=
null
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment