Skip to content

Commit

Permalink
get and merge templates in a for of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Nov 14, 2023
1 parent 4a547b7 commit 65eb8c3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mod/workspace/getLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ module.exports = async (params) => {
layer = merge(await getTemplate(workspace.templates[layer.template || layer.key]), layer)
}

if (Array.isArray(layer.templates)) {
if (Array.isArray(layer.templates)) for (const key of layer.templates){

// Merge templates from templates array into layer.
layer.templates.forEach(async template => {
let template = Object.hasOwn(workspace.templates, key) && await getTemplate(workspace.templates[key])

// Merge the workspace template into the layer.
layer = merge(await getTemplate(workspace.templates[template]), layer)
})
// Merge the workspace template into the layer.
layer = merge(template, layer)
}

// Check for layer geom[s].
Expand Down

0 comments on commit 65eb8c3

Please sign in to comment.