function typeContainsTypeParameter(type) { if (utils.isTypeReferenceNode(type)) { var typeName = type.typeName; if (typeName.kind === ts.SyntaxKind.Identifier && isTypeParameter(typeName.text)) { return true; } } return ts.forEachChild(type, typeContainsTypeParameter); }
return ts.forEachChild(ctx.sourceFile, function cb(node) { if (tsutils_1.isTypeReferenceNode(node)) { var typeName = node.getText(ctx.sourceFile); for (var _i = 0, _a = ctx.options; _i < _a.length; _i++) { var ban = _a[_i]; if (ban.pattern.test(typeName)) { ctx.addFailureAtNode(node, Rule.FAILURE_STRING_FACTORY(typeName, ban.message)); break; } } } return ts.forEachChild(node, cb); });
function returnTypeMatchesParent(parent, decl) { if (parent.name === undefined || decl.type === undefined || !tsutils_1.isTypeReferenceNode(decl.type)) { return false; } return decl.type.typeName.kind === ts.SyntaxKind.Identifier && decl.type.typeName.text === parent.name.text; }