Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScriptAttribute fix #6750

Merged
merged 4 commits into from
Jun 25, 2024
Prev Previous commit
Next Next commit
linting fixes
  • Loading branch information
marklundin committed Jun 25, 2024
commit 1097d9aeb2199968f30d1a33c65421525c994bc7
5 changes: 3 additions & 2 deletions src/framework/script/script-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ function attributeToValue(app, schema, value, current) {
*/
export function assignAttributesToScript(app, attributeSchemaMap, data, script) {

if(!data) return;
if (!data) return;

// Iterate over the schema and assign corresponding data
for (const attributeName in attributeSchemaMap) {
const attributeSchema = attributeSchemaMap[attributeName];
const dataToAssign = data[attributeName];

// Skip if the data is not defined
if(dataToAssign === undefined) continue;
if (dataToAssign === undefined) continue;

// Assign the value to the script based on the attribute schema
script[attributeName] = attributeToValue(app, attributeSchema, dataToAssign, script[attributeName]);
Expand All @@ -204,6 +204,7 @@ export function assignAttributesToScript(app, attributeSchemaMap, data, script)
*/
class ScriptAttributes {
static assignAttributesToScript = assignAttributesToScript;

static attributeToValue = attributeToValue;

/**
Expand Down