I'm trying to compile the asset model using the reference from this page : https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/compiling-asset-model.htm
I'm trying to understand the code
function compile(asset, channel, mode) {
asset = asset || {};
var content = mode === AssetUtils.COMPILE_MODE.PREVIEW && (asset.superContent || asset.content || asset.design) || asset.content;
if (content) {
['slot', 'block'].forEach(function (type) {
var references = getReferences(content, type);
var types = type + 's';
references.forEach(function (reference) {
var refKey = reference.split('data-key="')[1].split('"')[0];
if (asset[types] && asset[types][refKey]) {
content = content.replace(reference, compile(asset[types][refKey]));
} else {
console.error('Bad Asset: referenced ' + type + ' does not exist: ' + refKey);
}
});
});
return content;
} else if (asset.views) {
if (asset.views[channel]) {
return compile(asset.views[channel], channel, mode);
} else if (asset.views.html) {
return compile(asset.views.html, channel, mode);
}
}
return '';}
I don't have any js external library reference, so what does it means the AssetUtils.COMPILE_MODE, where can I find this lib ?
Moreover I'm trying to parse a json file, and I don't know what parameters to pass for this function