aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 751 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.constructInfoFromConstruct=constructInfoFromConstruct;var errors_1=()=>{var tmp=require("../errors");return errors_1=()=>tmp,tmp};const JSII_RUNTIME_SYMBOL=Symbol.for("jsii.rtti");function constructInfoFromConstruct(construct){const jsiiRuntimeInfo=Object.getPrototypeOf(construct).constructor[JSII_RUNTIME_SYMBOL];if(typeof jsiiRuntimeInfo=="object"&&jsiiRuntimeInfo!==null&&typeof jsiiRuntimeInfo.fqn=="string"&&typeof jsiiRuntimeInfo.version=="string")return{fqn:jsiiRuntimeInfo.fqn,version:jsiiRuntimeInfo.version};if(jsiiRuntimeInfo)throw new(errors_1()).AssumptionError("MalformedJsiiRuntimeInfo",`malformed jsii runtime info for construct: '${construct.node.path}'`)}