Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((result = {}) => {
const getVersion = (url = "") => {
if (new URL(url).host === "localhost") {
return "local";
} else {
return url.substring(url.lastIndexOf("/") + 1);
}
};
const santaVersion = getVersion(get_(result, "santaBase"));
const editorVersion = getVersion(get_(result, "editorBase"));
logger.addSessionData({ santaVersion, editorVersion });
})
.catch(e => logger.warn(`error reading editor versions: ${e.message}`));