mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
33 lines
981 B
JavaScript
33 lines
981 B
JavaScript
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
var common = require('./ManagedReference.common.js');
|
|
|
|
exports.preTransform = function (model) {
|
|
transform(model);
|
|
|
|
function transform(item) {
|
|
if (item.children) item.children.forEach(function(i) {
|
|
transform(i);
|
|
});
|
|
}
|
|
|
|
return model;
|
|
}
|
|
|
|
exports.postTransform = function (model) {
|
|
var type = model.type.toLowerCase();
|
|
var category = common.getCategory(type);
|
|
if (category == 'class') {
|
|
var typePropertyName = common.getTypePropertyName(type);
|
|
if (typePropertyName) {
|
|
model[typePropertyName] = true;
|
|
}
|
|
if (model.children && model.children.length > 0) {
|
|
model.isCollection = true;
|
|
common.groupChildren(model, 'class');
|
|
} else {
|
|
model.isItem = true;
|
|
}
|
|
}
|
|
|
|
return model;
|
|
} |