Hello there, I’ve been trying to write down a method for casting the plasmic variant names with a regex, I think I might be still missing something as codegen is stripping out spaces and changing the capitalization on those, is there an official helper inside the plasmic lib I can use? I’ll share my code here, feel free to improve it
export function toPlasmicVariantName(str)
{
if (!str) return;
return str.replace(/[A-Z]([a-z]){1,}|[A-Z]{1,}/g, function(word, char, index) {
return index === 0 ? word.toLowerCase() : word.split('')[0].toUpperCase() + word.toLowerCase().substring(1);
}).replace(/\s|\_+/g, '');
}