* A type is free of this references if it's the any, string, number, boolean, symbol, or void keyword, a string * literal type, an array with an element type that is free of this references, or a type reference that is * free of this references.
(node)
| 57556 | * free of this references. |
| 57557 | */ |
| 57558 | function isThislessType(node) { |
| 57559 | switch (node.kind) { |
| 57560 | case 130 /* SyntaxKind.AnyKeyword */: |
| 57561 | case 155 /* SyntaxKind.UnknownKeyword */: |
| 57562 | case 150 /* SyntaxKind.StringKeyword */: |
| 57563 | case 147 /* SyntaxKind.NumberKeyword */: |
| 57564 | case 158 /* SyntaxKind.BigIntKeyword */: |
| 57565 | case 133 /* SyntaxKind.BooleanKeyword */: |
| 57566 | case 151 /* SyntaxKind.SymbolKeyword */: |
| 57567 | case 148 /* SyntaxKind.ObjectKeyword */: |
| 57568 | case 114 /* SyntaxKind.VoidKeyword */: |
| 57569 | case 153 /* SyntaxKind.UndefinedKeyword */: |
| 57570 | case 143 /* SyntaxKind.NeverKeyword */: |
| 57571 | case 196 /* SyntaxKind.LiteralType */: |
| 57572 | return true; |
| 57573 | case 183 /* SyntaxKind.ArrayType */: |
| 57574 | return isThislessType(node.elementType); |
| 57575 | case 178 /* SyntaxKind.TypeReference */: |
| 57576 | return !node.typeArguments || node.typeArguments.every(isThislessType); |
| 57577 | } |
| 57578 | return false; |
| 57579 | } |
| 57580 | /** A type parameter is thisless if its constraint is thisless, or if it has no constraint. */ |
| 57581 | function isThislessTypeParameter(node) { |
| 57582 | var constraint = ts.getEffectiveConstraintOfTypeParameter(node); |
no test coverage detected