Object.defineProperty(exports,"__esModule",{value:true});exports.getScopedVersion=exports.isUrlLocalhost=exports.getValidLocalhost=exports.replaceOverridesInString=exports.isSystemWin=exports.isSystemLinux=exports.isSystemMac=void 0;var isSystemMac=process.platform==='darwin';exports.isSystemMac=isSystemMac;

var isSystemLinux=process.platform==='linux';exports.isSystemLinux=isSystemLinux;

var isSystemWin=process.platform==='win32';exports.isSystemWin=isSystemWin;

var replaceOverridesInString=function replaceOverridesInString(string,overrides,mask){var _replacedString;
var replacedString=string;
if((overrides==null?void 0:overrides.length)&&((_replacedString=replacedString)==null?void 0:_replacedString.replace)){
overrides.forEach(function(v){
var regEx=new RegExp(v,'g');
replacedString=replacedString.replace(regEx,mask);
});
}
return replacedString;
};exports.replaceOverridesInString=replaceOverridesInString;

var getValidLocalhost=function getValidLocalhost(value,localhost){
if(!value)return localhost;
switch(value){
case'localhost':
case'0.0.0.0':
case'127.0.0.1':
return localhost;
default:
return value;}

};exports.getValidLocalhost=getValidLocalhost;

var isUrlLocalhost=function isUrlLocalhost(value){
if(value==null?void 0:value.includes){
if(value.includes('localhost'))return true;
if(value.includes('0.0.0.0'))return true;
if(value.includes('127.0.0.1'))return true;
}
return false;
};exports.isUrlLocalhost=isUrlLocalhost;


var getScopedVersion=function getScopedVersion(c,key,val,sourceObjKey){
if(typeof val==='string'){
if(val.startsWith('source:')){var _c$buildConfig;
var sourceObj=(_c$buildConfig=c.buildConfig)==null?void 0:_c$buildConfig[sourceObjKey];
if(sourceObj){var _sourceObj$key;
return(_sourceObj$key=sourceObj[key])==null?void 0:_sourceObj$key.version;
}
}else{
return val;
}
}else{
return val==null?void 0:val.version;
}
return null;
};exports.getScopedVersion=getScopedVersion;
//# sourceMappingURL=utils.js.map