Name
sn_devstudio.FileTypeMap
Description
Mapping function to convert AppExplorerTree to a map of table names to their parent types as defined in Studio.
Script
var FileTypeMap = (function() {
var appExplorerStructure = AppExplorerStructure.create(),
categoryTree = appExplorerStructure.categoryTree(),
types = {};
return {
studioTypeForTable: function(tableName) {
if (_.isEmpty(types)) {
types = _.chain(categoryTree)
.pluck('types')
.flatten()
.indexBy('id')
.value();
}
return types[tableName];
}
};
})();
Sys ID
1c7a3cb537011200612747efbe41f121