* Check if a version range satisfies the latest version
(versionRange, latestVersion)
| 102 | * Check if a version range satisfies the latest version |
| 103 | */ |
| 104 | function isVersionRangeOutdated(versionRange, latestVersion) { |
| 105 | try { |
| 106 | // Clean the version range (remove any npm-specific prefixes) |
| 107 | const cleanRange = versionRange.replace(/^npm:/, '').split('@').pop() |
| 108 | |
| 109 | // Check if the range satisfies the latest version |
| 110 | return !semver.satisfies(latestVersion, cleanRange) |
| 111 | } catch (error) { |
| 112 | console.warn( |
| 113 | `${colors.yellow}Warning: Could not parse version range "${versionRange}": ${error.message}${colors.reset}`, |
| 114 | ) |
| 115 | return false |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Update package.json file with new versions |
no test coverage detected