Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d8f14e commit 09061c0Copy full SHA for 09061c0
lib/hosts.js
@@ -4,7 +4,11 @@
4
5
const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : ''
6
const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : ''
7
-const formatHashFragment = (f) => f.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-')
+const formatHashFragment = (f) => f.toLowerCase()
8
+ .replace(/^\W+/g, '') // strip leading non-characters
9
+ .replace(/\W+$/g, '') // strip trailing non-characters
10
+ .replace(/\//g, '') // strip all slashes
11
+ .replace(/\W+/g, '-') // replace remaining non-characters with '-'
12
13
const defaults = {
14
sshtemplate: ({ domain, user, project, committish }) =>
0 commit comments