diff --git a/src/package-manifest.test.ts b/src/package-manifest.test.ts index e0270b8..08c02cc 100644 --- a/src/package-manifest.test.ts +++ b/src/package-manifest.test.ts @@ -67,7 +67,7 @@ describe('package-manifest', () => { b: '^2.0.0', c: '~4.3.0', d: 'workspace:^', - e: 'npm:a@^2.0.0', + e: 'npm:@a/abc@^2.0.0', }, }; const validated = { @@ -80,7 +80,7 @@ describe('package-manifest', () => { b: '^2.0.0', c: '~4.3.0', d: 'workspace:^', - e: 'npm:a@^2.0.0', + e: 'npm:@a/abc@^2.0.0', }, peerDependencies: {}, }; @@ -317,7 +317,9 @@ describe('package-manifest', () => { name: 'foo', version: '1.0.0', peerDependencies: { - a: 12345, + a: 'npm:@foo', + b: 'npm:foo@', + c: '12345', }, }), ); diff --git a/src/package-manifest.ts b/src/package-manifest.ts index 94a1613..6451c65 100644 --- a/src/package-manifest.ts +++ b/src/package-manifest.ts @@ -174,7 +174,8 @@ function isValidPackageManifestDependencyValue( try { const redirectedDependencyMatch = redirectedDependencyRegexp.exec(version); - if (!redirectedDependencyMatch || redirectedDependencyMatch.length < 3) { + /* istanbul ignore if */ + if (!redirectedDependencyMatch) { return false; } @@ -184,6 +185,7 @@ function isValidPackageManifestDependencyValue( isValidPackageManifestVersionField(redirectedVersion) ); } catch (e) { + /* istanbul ignore next */ return false; } }