Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/git-up/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
// Dependencies
var parseUrl = require("parse-url"),
isSsh = require("is-ssh");
/**
* gitUp
* Parses the input url.
*
* @name gitUp
* @function
* @param {String} input The input url.
* @return {Object} An object containing the following fields:
*
* - `protocols` (Array): An array with the url protocols (usually it has one element).
* - `port` (null|Number): The domain port.
* - `resource` (String): The url domain (including subdomains).
* - `user` (String): The authentication user (usually for ssh urls).
* - `pathname` (String): The url pathname.
* - `hash` (String): The url hash.
* - `search` (String): The url querystring value.
* - `href` (String): The input url.
* - `protocol` (String): The git url protocol.
* - `token` (String): The oauth token (could appear in the https urls).
*/
function gitUp(input) {
var output = parseUrl(input);
output.token = "";
var splits = output.user.split(":");
if (splits.length === 2) {
if (splits[1] === "x-oauth-basic") {
output.token = splits[0];
} else if (splits[0] === "x-token-auth") {
output.token = splits[1];
}
}
if (isSsh(output.protocols) || isSsh(input)) {
output.protocol = "ssh";
} else if (output.protocols.length) {
output.protocol = output.protocols[0];
} else {
output.protocol = "file";
}
output.href = output.href.replace(/\/$/, "");
return output;
}
module.exports = gitUp; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]-- |