in src/declarative-stack.ts [266:282]
function deconstructEnumLike(stack: cdk.Stack, typeRef: reflect.TypeReference, value: any) {
if (!isEnumLikeClass(typeRef.type)) {
return undefined;
}
// if the value is a string, we deconstruct it as a static property
if (typeof(value) === 'string') {
return deconstructStaticProperty(typeRef.type, value);
}
// if the value is an object, we deconstruct it as a static method
if (typeof(value) === 'object' && !Array.isArray(value)) {
return deconstructStaticMethod(stack, typeRef.type, value);
}
throw new Error(`Invalid value for enum-like class ${typeRef.fqn}: ${JSON.stringify(value)}`);
}