mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
15 lines
499 B
JavaScript
15 lines
499 B
JavaScript
module.exports = function loadNestedTagHelper(targetProperty, isRepeated) {
|
|
return function(input, parent) {
|
|
// If we are nested tag then we do not have a renderer
|
|
if (isRepeated) {
|
|
var existingArray = parent[targetProperty];
|
|
if (existingArray) {
|
|
existingArray.push(input);
|
|
} else {
|
|
parent[targetProperty] = [input];
|
|
}
|
|
} else {
|
|
parent[targetProperty] = input;
|
|
}
|
|
};
|
|
}; |