Skip to content

Commit

Permalink
chore: change peer-api check to equals
Browse files Browse the repository at this point in the history
  • Loading branch information
Flarna committed May 6, 2022
1 parent 4b68445 commit b5161b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/peer-api-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

const path = require('path');
const semver = require('semver');

const appRoot = process.cwd();
const packageJsonUrl = path.resolve(`${appRoot}/package.json`);
Expand All @@ -34,10 +33,10 @@ if (pjson.dependencies && pjson.dependencies['@opentelemetry/api']) {
const peerVersion = pjson.peerDependencies && pjson.peerDependencies['@opentelemetry/api'];
const devVersion = pjson.devDependencies && pjson.devDependencies['@opentelemetry/api'];
if (peerVersion) {
if (!semver.satisfies(devVersion, peerVersion)) {
if (devVersion !== peerVersion)) {
throw new Error(
`Package ${pjson.name} depends on peer API version ${peerVersion} ` +
`but version ${devVersion} in development which doesn't satisfy the peer API version`
`but version ${devVersion} in development which doesn't match the peer API version`
);
}
console.log(`${pjson.name} OK`);
Expand Down

0 comments on commit b5161b8

Please sign in to comment.