MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / isPrimitiveType

Function isPrimitiveType

packages/transpiler/src/BuilderHelpers.ts:77–99  ·  view source on GitHub ↗
(type: ts.Type | null)

Source from the content-addressed store, hash-verified

75}
76
77export 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
101export function isNumberType(type: ts.Type | null) {
102 if (!type) {

Callers 3

fillBaseInfoFromFunction · 0.90
getTypeWithNullableInfoFunction · 0.90
unwrapArrayItemTypeFunction · 0.85

Calls 1

hasFlagFunction · 0.70

Tested by

no test coverage detected