aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.1 kB
JavaScript
var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FeatureFlags=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},errors_1=()=>{var tmp=require("./errors");return errors_1=()=>tmp,tmp},cxapi=()=>{var tmp=require("../../cx-api");return cxapi=()=>tmp,tmp};class FeatureFlags{static of(scope){return new FeatureFlags(scope)}constructor(construct){this.construct=construct}isEnabled(featureFlag){const context=constructs_1().Node.of(this.construct).tryGetContext(featureFlag);if(cxapi().CURRENT_VERSION_EXPIRED_FLAGS.includes(featureFlag)){if(context!==void 0)throw new(errors_1()).UnscopedValidationError(`Unsupported feature flag '${featureFlag}'. This flag existed on CDKv1 but has been removed in CDKv2. CDK will now behave as the same as when the flag is enabled.`);return!0}return context!==void 0?!!context:cxapi().futureFlagDefault(featureFlag)}}exports.FeatureFlags=FeatureFlags,_a=JSII_RTTI_SYMBOL_1,FeatureFlags[_a]={fqn:"aws-cdk-lib.FeatureFlags",version:"2.202.0"};
;