Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map(name => {
const dep = allDeps[name];
return {
name,
requiredVersion: dep.requiredVersion,
installedVersion: dep.installedVersion,
latestVersion: dep.latestVersion,
status: (dep.latestVersion && dep.installedVersion !== '--')
? semverDiff(dep.installedVersion, dep.latestVersion) + '' // eslint-disable-line
: '',
};
})
.sort((a, b) => a.name.localeCompare(b.name));
browser.runtime.onInstalled.addListener(async ({ reason, previousVersion }) => {
if (reason === 'update') {
const { installType } = await browser.management.getSelf()
if (installType === 'development') {
return
}
const { version } = browser.runtime.getManifest()
const versionDiffType = semverDiff(previousVersion, version)
if (versionDiffType === null || versionDiffType === 'patch') {
return
}
const changelogUrl = changelogs[version]
if (changelogUrl) {
const {
updateNotificationType,
updateNotifications
} = await storage.getAll()
switch (updateNotificationType) {
// Tab
case UPDATE_NOTIFICATION_TYPES[0]: {
browser.tabs.create({
function updateCallback (err, update) {
if (err) {
throw Error(err)
}
if (!semverDiff(update.current, update.latest)) {
return
}
this.update = update
this.notify()
}
const serviceValue = appInfo[serviceKey];
if (!(serviceValue && serviceValue.build)) return false;
const currentVersion = serviceValue.build.version;
if (!currentVersion) return false;
const latestVersion = latestServiceVersions[serviceValue.build.repo];
services[serviceKey] = {
name: serviceValue.build.name,
version: serviceValue.build.version,
newVersion: latestVersion || null,
repo: serviceValue.build.repo || null,
isDeprecated:
serviceValue.build.repo && latestVersion && semverDiff(currentVersion, latestVersion),
};
return true;
});
const outDatedDependents = dependents.reduce((acc1, dependent) => {
const dependentVersion = semverRegex().exec(dependent.version)![0]
const diff = semverDiff(dependentVersion, libraryVersion)
return diff === 'major' ? acc1 + 1 : acc1
}, 0)
return {