Javascript plugin - initialize a variable - help

Hi There,

Writing a plugin i cannot passa a variable to plugin…

function upload
‘function(instance, properties, context) {
$(document).ready(function(){
var validFormats = properties.validFormats || [‘jpg’, ‘jpeg’, ‘png’, ‘webp’];
instance.publishState(‘validFormats’, validFormats);

}’

In my plugin i set

only validFormats does not goes to the plugin… All other variables working !
Any Idea what might be happening?
Default values mantain unchanged…
Obs.: ‘1’, ‘2’ are testing values…

Tks!

function upload(instance, properties, context) {
$(document).ready(function() {
var validFormats = properties.validFormats || [‘jpg’, ‘jpeg’, ‘png’, ‘webp’]; // Ensure properties.validFormats exists, otherwise use a default
console.log(‘validFormats:’, validFormats); // Log the value for inspection

instance.publishState('validFormats', validFormats);
// ... rest of your code

});