(rangeSpec)
| 262 | // True if `rangeSpec` is one or more exact versions joined by `||`. Anything |
| 263 | // containing comparator operators (^, ~, >=, <, *) returns false. |
| 264 | const isExactVersionDisjunction = (rangeSpec) => { |
| 265 | /* istanbul ignore next: caller always passes parsed.fetchSpec, which |
| 266 | npa guarantees to be a non-empty string for range specs. */ |
| 267 | if (typeof rangeSpec !== 'string' || rangeSpec.trim() === '') { |
| 268 | return false |
| 269 | } |
| 270 | const parts = rangeSpec.split('||').map(p => p.trim()) |
| 271 | /* istanbul ignore next: String.prototype.split always returns at least |
| 272 | one element; defensive guard only. */ |
| 273 | if (parts.length === 0) { |
| 274 | return false |
| 275 | } |
| 276 | return parts.every(p => p !== '' && semver.valid(p) !== null) |
| 277 | } |
| 278 | |
| 279 | const matchGit = (node, parsed) => { |
| 280 | if (!node.resolved || !node.resolved.startsWith('git')) { |
no test coverage detected