MCPcopy Create free account
hub / github.com/babel/babel / isTypeScript

Function isTypeScript

packages/babel-types/src/validators/generated/index.ts:4999–5080  ·  view source on GitHub ↗
(
  node: t.Node | null | undefined,
  opts?: Opts | null,
)

Source from the content-addressed store, hash-verified

4997 opts?: Opts | null,
4998): node is t.TypeScript & Opts;
4999export function isTypeScript<Opts extends Options<t.TypeScript>>(
5000 node: t.Node | null | undefined,
5001 opts?: Opts | null,
5002): boolean {
5003 if (!node) return false;
5004
5005 switch (node.type) {
5006 case "TSParameterProperty":
5007 case "TSDeclareFunction":
5008 case "TSDeclareMethod":
5009 case "TSQualifiedName":
5010 case "TSCallSignatureDeclaration":
5011 case "TSConstructSignatureDeclaration":
5012 case "TSPropertySignature":
5013 case "TSMethodSignature":
5014 case "TSIndexSignature":
5015 case "TSAnyKeyword":
5016 case "TSBooleanKeyword":
5017 case "TSBigIntKeyword":
5018 case "TSIntrinsicKeyword":
5019 case "TSNeverKeyword":
5020 case "TSNullKeyword":
5021 case "TSNumberKeyword":
5022 case "TSObjectKeyword":
5023 case "TSStringKeyword":
5024 case "TSSymbolKeyword":
5025 case "TSUndefinedKeyword":
5026 case "TSUnknownKeyword":
5027 case "TSVoidKeyword":
5028 case "TSThisType":
5029 case "TSFunctionType":
5030 case "TSConstructorType":
5031 case "TSTypeReference":
5032 case "TSTypePredicate":
5033 case "TSTypeQuery":
5034 case "TSTypeLiteral":
5035 case "TSArrayType":
5036 case "TSTupleType":
5037 case "TSOptionalType":
5038 case "TSRestType":
5039 case "TSNamedTupleMember":
5040 case "TSUnionType":
5041 case "TSIntersectionType":
5042 case "TSConditionalType":
5043 case "TSInferType":
5044 case "TSParenthesizedType":
5045 case "TSTypeOperator":
5046 case "TSIndexedAccessType":
5047 case "TSMappedType":
5048 case "TSTemplateLiteralType":
5049 case "TSLiteralType":
5050 case "TSClassImplements":
5051 case "TSInterfaceHeritage":
5052 case "TSInterfaceDeclaration":
5053 case "TSInterfaceBody":
5054 case "TSTypeAliasDeclaration":
5055 case "TSInstantiationExpression":
5056 case "TSAsExpression":

Callers

nothing calls this directly

Calls 1

shallowEqualFunction · 0.85

Tested by

no test coverage detected