mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-24 13:53:23 +03:00
17 lines
386 B
JavaScript
17 lines
386 B
JavaScript
export const groomingServerName = (serverName, prefix1) => {
|
|
const PREFIX1 = prefix1 || 'https://';
|
|
const PREFIX2 = 'https://';
|
|
|
|
if (!serverName) {
|
|
return null;
|
|
}
|
|
|
|
if (serverName.indexOf(PREFIX1) === 0) {
|
|
return serverName.substr(PREFIX1.length);
|
|
}
|
|
if (serverName.indexOf(PREFIX2) === 0) {
|
|
return serverName.substr(PREFIX2.length);
|
|
}
|
|
return serverName;
|
|
};
|