summaryrefslogtreecommitdiff
path: root/school/node_modules/axios/lib/helpers/parseProtocol.js
diff options
context:
space:
mode:
Diffstat (limited to 'school/node_modules/axios/lib/helpers/parseProtocol.js')
-rw-r--r--school/node_modules/axios/lib/helpers/parseProtocol.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/school/node_modules/axios/lib/helpers/parseProtocol.js b/school/node_modules/axios/lib/helpers/parseProtocol.js
new file mode 100644
index 0000000..586ec96
--- /dev/null
+++ b/school/node_modules/axios/lib/helpers/parseProtocol.js
@@ -0,0 +1,6 @@
+'use strict';
+
+export default function parseProtocol(url) {
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+}