flow-immutable-models
Version:
Generates model classes from Flow types using Immutable.js
35 lines (27 loc) • 888 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getNonClassTypes;
var _withoutModelTypeSuffix = require('./withoutModelTypeSuffix');
function getNonClassImportedTypes(j, root) {
var names = [];
root.find(j.TypeAlias).filter(function (path) {
return !(0, _withoutModelTypeSuffix.endsWithModelType)(path.node.id.name);
}).forEach(function (path) {
return names.push(path.node.id.name);
});
return names;
}
function getNonClassInlineTypes(j, root) {
var names = [];
root.find(j.TypeAlias).filter(function (path) {
return !(0, _withoutModelTypeSuffix.endsWithModelType)(path.node.id.name);
}).forEach(function (path) {
return names.push(path.node.id.name);
});
return names;
}
function getNonClassTypes(j, root) {
return getNonClassInlineTypes(j, root).concat(getNonClassImportedTypes(j, root));
}