UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 907 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnPropsMixin=void 0;var cfn_resource_1=()=>{var tmp=require("../cfn-resource");return cfn_resource_1=()=>tmp,tmp},property_merge_strategy_1=()=>{var tmp=require("../mixins/property-merge-strategy");return property_merge_strategy_1=()=>tmp,tmp};class CfnPropsMixin{cfnResourceType;props;propertyKeys;strategy;constructor(resourceClass,props,options={}){this.cfnResourceType=resourceClass.CFN_RESOURCE_TYPE_NAME,this.props=props,this.propertyKeys=Object.keys(props),this.strategy=options.strategy??property_merge_strategy_1().PropertyMergeStrategy.combine()}supports(construct){return cfn_resource_1().CfnResource.isCfnResource(construct)&&construct.cfnResourceType===this.cfnResourceType}applyTo(construct){this.supports(construct)&&this.strategy.apply(construct,this.props,this.propertyKeys)}}exports.CfnPropsMixin=CfnPropsMixin;