How to use the diff function from semver
Find comprehensive JavaScript semver.diff code examples handpicked from public code repositorys.
GitHub: Serzhanov/Studies
325 326 327 328 329 330 331 332 333 334
? 'next' : 'latest' : 'latest'; let version = info.npmPackageJson['dist-tags'][tag]; let target = info.npmPackageJson.versions[version]; const versionDiff = semver.diff(info.installed.version, version); if (versionDiff !== 'patch' && versionDiff !== 'minor' && /^@(?:angular|nguniversal)\//.test(name)) { const installedMajorVersion = (_a = semver.parse(info.installed.version)) === null || _a === void 0 ? void 0 : _a.major;
1
0
0
471 472 473 474 475 476 477 478 479
return node } // look for newer versions that differ from current by a specific part of the semver version if (['major', 'minor', 'patch'].includes(outdatedKind)) { // filter the versions greater than our current one based on semver.diff const filteredVersions = greaterVersions.filter((version) => { return semver.diff(node.version, version) === outdatedKind })
0
0
1
+ 9 other calls in file
semver.gte is the most popular function in semver (528 examples)