(type: ts.Type | null)
| 75 | } |
| 76 | |
| 77 | export function isPrimitiveType(type: ts.Type | null) { |
| 78 | if (!type) { |
| 79 | return false; |
| 80 | } |
| 81 | |
| 82 | if (hasFlag(type, ts.TypeFlags.Number)) { |
| 83 | return true; |
| 84 | } |
| 85 | if (hasFlag(type, ts.TypeFlags.String)) { |
| 86 | return true; |
| 87 | } |
| 88 | if (hasFlag(type, ts.TypeFlags.Boolean)) { |
| 89 | return true; |
| 90 | } |
| 91 | if (hasFlag(type, ts.TypeFlags.BigInt)) { |
| 92 | return true; |
| 93 | } |
| 94 | if (hasFlag(type, ts.TypeFlags.Unknown)) { |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | return false; |
| 99 | } |
| 100 | |
| 101 | export function isNumberType(type: ts.Type | null) { |
| 102 | if (!type) { |
no test coverage detected