@sap-cloud-sdk/connectivity
Version:
SAP Cloud SDK for JavaScript connectivity
21 lines • 625 B
JavaScript
;
/* eslint-disable import/export */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProtocol = getProtocol;
const protocols = {
http: 'http',
https: 'https',
socks: 'socks'
};
/**
* @internal
* Get {@link Protocol} from its string representation.
* @param protocol - Protocol as string, either 'http'/'https' or 'http:'/'https:'.
* @returns Either the matching protocol or undefined.
*/
function getProtocol(protocol) {
return protocol.endsWith(':')
? getProtocol(protocol.slice(0, -1))
: protocols[protocol];
}
//# sourceMappingURL=protocol.js.map