Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-cdk/assert

Package Overview
Dependencies
Maintainers
4
Versions
420
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/assert - npm Package Compare versions

Comparing version 0.8.2 to 0.9.0

key.snk

17

lib/assertions/have-resource.d.ts

@@ -11,3 +11,3 @@ import { Assertion } from "../assertion";

*/
export declare function haveResource(resourceType: string, properties?: any): Assertion<StackInspector>;
export declare function haveResource(resourceType: string, properties?: any, comparison?: ResourcePart): Assertion<StackInspector>;
/**

@@ -19,1 +19,16 @@ * Return whether `superObj` is a super-object of `obj`.

export declare function isSuperObject(superObj: any, obj: any): boolean;
/**
* What part of the resource to compare
*/
export declare enum ResourcePart {
/**
* Only compare the resource's properties
*/
Properties = 0,
/**
* Check the entire CloudFormation config
*
* (including UpdateConfig, DependsOn, etc.)
*/
CompleteDefinition = 1
}

46

lib/assertions/have-resource.js

@@ -12,8 +12,8 @@ "use strict";

*/
function haveResource(resourceType, properties) {
return new HaveResourceAssertion(resourceType, properties);
function haveResource(resourceType, properties, comparison) {
return new HaveResourceAssertion(resourceType, properties, comparison);
}
exports.haveResource = haveResource;
class HaveResourceAssertion extends assertion_1.Assertion {
constructor(resourceType, properties) {
constructor(resourceType, properties, part) {
super();

@@ -23,2 +23,4 @@ this.resourceType = resourceType;

this.inspected = [];
this.predicate = typeof properties === 'function' ? properties : makeSuperObjectPredicate(properties);
this.part = part !== undefined ? part : ResourcePart.Properties;
}

@@ -30,12 +32,4 @@ assertUsing(inspector) {

this.inspected.push(resource);
let matches;
if (typeof this.properties === 'function') {
// If 'properties' is a callable, invoke it
matches = this.properties(resource.Properties);
}
else {
// Otherwise treat as property bag that we check superset of
matches = isSuperObject(resource.Properties, this.properties);
}
if (matches) {
const propsToCheck = this.part === ResourcePart.Properties ? resource.Properties : resource;
if (this.predicate(propsToCheck)) {
return true;

@@ -58,2 +52,10 @@ }

/**
* Make a predicate that checks property superset
*/
function makeSuperObjectPredicate(obj) {
return (resourceProps) => {
return isSuperObject(resourceProps, obj);
};
}
/**
* Return whether `superObj` is a super-object of `obj`.

@@ -99,2 +101,18 @@ *

exports.isSuperObject = isSuperObject;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGF2ZS1yZXNvdXJjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImhhdmUtcmVzb3VyY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw0Q0FBeUM7QUFHekM7Ozs7Ozs7R0FPRztBQUNILFNBQWdCLFlBQVksQ0FBQyxZQUFvQixFQUFFLFVBQWdCO0lBQy9ELE9BQU8sSUFBSSxxQkFBcUIsQ0FBQyxZQUFZLEVBQUUsVUFBVSxDQUFDLENBQUM7QUFDL0QsQ0FBQztBQUZELG9DQUVDO0FBRUQsTUFBTSxxQkFBc0IsU0FBUSxxQkFBeUI7SUFHekQsWUFBNkIsWUFBb0IsRUFDcEIsVUFBZ0I7UUFDekMsS0FBSyxFQUFFLENBQUM7UUFGaUIsaUJBQVksR0FBWixZQUFZLENBQVE7UUFDcEIsZUFBVSxHQUFWLFVBQVUsQ0FBTTtRQUhyQyxjQUFTLEdBQVUsRUFBRSxDQUFDO0lBSzlCLENBQUM7SUFFTSxXQUFXLENBQUMsU0FBeUI7UUFDeEMsS0FBSyxNQUFNLFNBQVMsSUFBSSxNQUFNLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLEVBQUU7WUFDNUQsTUFBTSxRQUFRLEdBQUcsU0FBUyxDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsU0FBUyxDQUFDLENBQUM7WUFDdEQsSUFBSSxRQUFRLENBQUMsSUFBSSxLQUFLLElBQUksQ0FBQyxZQUFZLEVBQUU7Z0JBQ3JDLElBQUksQ0FBQyx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N0IGtleSBvZiBPYmplY3Qua2V5cyhvYmopKSB7XG4gICAgICAgICAgICBpZiAoIShrZXkgaW4gc3VwZXJPYmopKSB7IHJldHVybiBmYWxzZTsgfVxuXG4gICAgICAgICAgICBpZiAoIWlzU3VwZXJPYmplY3Qoc3VwZXJPYmpba2V5XSwgb2JqW2tleV0pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgICByZXR1cm4gc3VwZXJPYmogPT09IG9iajtcbn1cbiJdfQ==
/**
* What part of the resource to compare
*/
var ResourcePart;
(function (ResourcePart) {
/**
* Only compare the resource's properties
*/
ResourcePart[ResourcePart["Properties"] = 0] = "Properties";
/**
* Check the entire CloudFormation config
*
* (including UpdateConfig, DependsOn, etc.)
*/
ResourcePart[ResourcePart["CompleteDefinition"] = 1] = "CompleteDefinition";
})(ResourcePart = exports.ResourcePart || (exports.ResourcePart = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGF2ZS1yZXNvdXJjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImhhdmUtcmVzb3VyY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw0Q0FBeUM7QUFHekM7Ozs7Ozs7R0FPRztBQUNILFNBQWdCLFlBQVksQ0FBQyxZQUFvQixFQUFFLFVBQWdCLEVBQUUsVUFBeUI7SUFDMUYsT0FBTyxJQUFJLHFCQUFxQixDQUFDLFlBQVksRUFBRSxVQUFVLEVBQUUsVUFBVSxDQUFDLENBQUM7QUFDM0UsQ0FBQztBQUZELG9DQUVDO0FBSUQsTUFBTSxxQkFBc0IsU0FBUSxxQkFBeUI7SUFLekQsWUFBNkIsWUFBb0IsRUFDcEIsVUFBZ0IsRUFDakMsSUFBbUI7UUFDM0IsS0FBSyxFQUFFLENBQ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qoc3VwZXJPYmpbaV0sIG9ialtpXSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIGlmICgodHlwZW9mIHN1cGVyT2JqID09PSAnb2JqZWN0JykgIT09ICh0eXBlb2Ygb2JqID09PSAnb2JqZWN0JykpIHsgcmV0dXJuIGZhbHNlOyB9XG4gICAgaWYgKHR5cGVvZiBvYmogPT09ICdvYmplY3QnKSB7XG4gICAgICAgIGZvciAoY29uc3Qga2V5IG9mIE9iamVjdC5rZXlzKG9iaikpIHtcbiAgICAgICAgICAgIGlmICghKGtleSBpbiBzdXBlck9iaikpIHsgcmV0dXJuIGZhbHNlOyB9XG5cbiAgICAgICAgICAgIGlmICghaXNTdXBlck9iamVjdChzdXBlck9ialtrZXldLCBvYmpba2V5XSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIHJldHVybiBzdXBlck9iaiA9PT0gb2JqO1xufVxuXG4vKipcbiAqIFdoYXQgcGFydCBvZiB0aGUgcmVzb3VyY2UgdG8gY29tcGFyZVxuICovXG5leHBvcnQgZW51bSBSZXNvdXJjZVBhcnQge1xuICAgIC8qKlxuICAgICAqIE9ubHkgY29tcGFyZSB0aGUgcmVzb3VyY2UncyBwcm9wZXJ0aWVzXG4gICAgICovXG4gICAgUHJvcGVydGllcyxcblxuICAgIC8qKlxuICAgICAqIENoZWNrIHRoZSBlbnRpcmUgQ2xvdWRGb3JtYXRpb24gY29uZmlnXG4gICAgICpcbiAgICAgKiAoaW5jbHVkaW5nIFVwZGF0ZUNvbmZpZywgRGVwZW5kc09uLCBldGMuKVxuICAgICAqL1xuICAgIENvbXBsZXRlRGVmaW5pdGlvblxufSJdfQ==
{
"name": "@aws-cdk/assert",
"version": "0.8.2",
"version": "0.9.0",
"description": "An assertion library for use with CDK Apps",

@@ -26,9 +26,9 @@ "main": "lib/index.js",

"devDependencies": {
"cdk-build-tools": "^0.8.2",
"pkglint": "^0.8.2"
"cdk-build-tools": "^0.9.0",
"pkglint": "^0.9.0"
},
"dependencies": {
"@aws-cdk/cdk": "^0.8.2",
"@aws-cdk/cloudformation-diff": "^0.8.2",
"@aws-cdk/cx-api": "^0.8.2",
"@aws-cdk/cdk": "^0.9.0",
"@aws-cdk/cloudformation-diff": "^0.9.0",
"@aws-cdk/cx-api": "^0.9.0",
"source-map-support": "^0.5.6"

@@ -35,0 +35,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc