* Normalizes version. * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies * @param {string} versionDesc version to be normalized * @returns {string} normalized version
(versionDesc)
| 416 | * @returns {string} normalized version |
| 417 | */ |
| 418 | function normalizeVersion(versionDesc) { |
| 419 | versionDesc = (versionDesc && versionDesc.trim()) || ""; |
| 420 | |
| 421 | if (isRequiredVersion(versionDesc)) { |
| 422 | return versionDesc; |
| 423 | } |
| 424 | |
| 425 | // add handle for URL Dependencies |
| 426 | return getGitUrlVersion(versionDesc.toLowerCase()); |
| 427 | } |
| 428 | |
| 429 | module.exports.normalizeVersion = normalizeVersion; |
no test coverage detected