Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
3pia
VISPA
VISPA web
Commits
b7acb0f7
Commit
b7acb0f7
authored
Oct 23, 2017
by
Benjamin Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Utils: added tool to clean file paths (of /./ and /foo/../)
parent
d06837d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
vispa/static/js/utils.js
vispa/static/js/utils.js
+15
-0
No files found.
vispa/static/js/utils.js
View file @
b7acb0f7
...
...
@@ -268,6 +268,21 @@ define(["require"], function(require) {
}
};
},
/** indent: 1
* .. js:function:: cleanPath(path)
*
* :param String path: The path to clean up.
*
* :return: The cleaned path.
* :rtype: String
*/
cleanPath
:
function
(
path
)
{
return
path
.
replace
(
/
\/
+/g
,
"
/
"
).
replace
(
/
\/\.(?=\/
|$
)
/g
,
""
).
replace
(
/
\/[^\/]
+
\/\.\.(?=\/
|$
)
/g
,
""
);
}
};
return
Utils
;
...
...
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