UNPKG
@gentrace/core
Version:
latest (3.5.12)
3.5.12
3.5.11
3.5.10
3.5.9
3.5.8
3.5.7
3.5.6
3.5.5
3.5.4
3.5.3
3.5.2
3.5.1
3.5.0
3.4.1
3.4.0
3.3.0
3.2.1
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
2.8.3
2.8.2
2.8.1
2.7.1
2.7.0
2.6.1
2.6.0
2.5.4
2.5.3
2.5.2
2.5.1
2.5.0
2.4.9
2.4.8
2.4.7
2.4.6
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.1
2.3.0
2.2.13
2.2.12
2.2.11
2.2.10
2.2.9
2.2.8
2.2.7
2.2.6
2.2.5
2.2.4
2.2.3
2.2.2
2.2.1
2.2.0
2.1.17
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.10
2.1.9
2.1.8
2.1.7
2.1.6
2.1.5
2.1.2
2.1.1
Core Gentrace Node.JS library
github.com/gentrace/gentrace-node
gentrace/gentrace-node
@gentrace/core
/
axios-unsafe-lib
/
helpers
/
parseProtocol.js
7 lines
(5 loc)
•
151 B
JavaScript
View Raw
1
2
3
4
5
6
7
'use strict'
;
export
default
function
parseProtocol
(
url
) {
const
match =
/^([-+\w]{1,25})(:?\/\/|:)/
.
exec
(url);
return
match && match[
1
] ||
''
; }