Skip to content

Commit

Permalink
Merge branch 'main' into bobertzh/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HBobertz authored Oct 5, 2023
2 parents c02bb96 + 495dafa commit 7af64c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-sns-subscriptions/lib/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class SqsSubscription implements sns.ITopicSubscription {
public bind(topic: sns.ITopic): sns.TopicSubscriptionConfig {
// Create subscription under *consuming* construct to make sure it ends up
// in the correct stack in cases of cross-stack subscriptions.
if (!(this.queue instanceof Construct)) {
if (!Construct.isConstruct(this.queue)) {
throw new Error('The supplied Queue object must be an instance of Construct');
}
const snsServicePrincipal = new iam.ServicePrincipal('sns.amazonaws.com');
Expand Down
12 changes: 6 additions & 6 deletions tools/@aws-cdk/pkglint/lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,16 +1043,16 @@ export class RegularDependenciesMustSatisfyPeerDependencies extends ValidationRu
public readonly name = 'dependencies/peer-dependencies-satisfied';

public validate(pkg: PackageJson): void {
for (const [depName, peerVersion] of Object.entries(pkg.peerDependencies)) {
const depVersion = pkg.dependencies[depName];
if (depVersion === undefined) { continue; }
for (const [depName, peerRange] of Object.entries(pkg.peerDependencies)) {
const depRange = pkg.dependencies[depName];
if (depRange === undefined) { continue; }

// Make sure that depVersion satisfies peerVersion.
if (!semver.intersects(depVersion, peerVersion)) {
if (!semver.intersects(depRange, peerRange, { includePrerelease: true })) {
pkg.report({
ruleName: this.name,
message: `dependency ${depName}: concrete version ${depVersion} does not match peer version '${peerVersion}'`,
fix: () => pkg.addPeerDependency(depName, depVersion),
message: `dependency ${depName}: concrete version ${depRange} does not match peer version '${peerRange}'`,
fix: () => pkg.addPeerDependency(depName, depRange),
});
}
}
Expand Down

0 comments on commit 7af64c5

Please sign in to comment.