Skip to content

Commit

Permalink
Cut-and-paste functions into checker.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Aug 18, 2022
1 parent e93ec04 commit 5e851e7
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 64 deletions.
64 changes: 64 additions & 0 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45779,6 +45779,70 @@ namespace ts {
}
}

export function isBigIntLiteralType(type: Type): type is BigIntLiteralType {
return !!(type.flags & TypeFlags.BigIntLiteral);
}

export function isConditionalType(type: Type): type is ConditionalType {
return !!(type.flags & TypeFlags.Conditional);
}

export function isIndexType(type: Type): type is IndexType {
return !!(type.flags & TypeFlags.Index);
}

export function isIndexedAccessType(type: Type): type is IndexedAccessType {
return !!(type.flags & TypeFlags.IndexedAccess);
}

export function isIntersectionType(type: Type): type is IntersectionType {
return !!(type.flags & TypeFlags.Intersection);
}

export function isNumberLiteralType(type: Type): type is NumberLiteralType {
return !!(type.flags & TypeFlags.NumberLiteral);
}

export function isObjectType(type: Type): type is ObjectType {
return !!(type.flags & TypeFlags.Object);
}

export function isStringMappingType(type: Type): type is StringMappingType {
return !!(type.flags & TypeFlags.StringMapping);
}

export function isSubstitutionType(type: Type): type is SubstitutionType {
return !!(type.flags & TypeFlags.Substitution);
}

export function isStringLiteralType(type: Type): type is StringLiteralType {
return !!(type.flags & TypeFlags.StringLiteral);
}

export function isTemplateLiteralType(type: Type): type is TemplateLiteralType {
return !!(type.flags & TypeFlags.TemplateLiteral);
}

export function isTypeParameterType(type: Type): type is TypeParameter {
return !!(type.flags & TypeFlags.TypeParameter);
}

export function isThisTypeParameter(type: Type): boolean {
return isTypeParameterType(type) && !!type.isThisType;
}

export function isTypeVariableType(type: Type): type is TypeVariable {
return !!(type.flags & TypeFlags.TypeVariable);
}

export function isUnionType(type: Type): type is UnionType {
return !!(type.flags & TypeFlags.Union);
}

export function isUnionOrIntersectionType(type: Type): type is IntersectionType | UnionType {
return !!(type.flags & TypeFlags.UnionOrIntersection);
}

namespace JsxNames {
export const JSX = "JSX" as __String;
export const IntrinsicElements = "IntrinsicElements" as __String;
Expand Down
64 changes: 0 additions & 64 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7670,70 +7670,6 @@ namespace ts {
factory.createStringLiteral(name, !!singleQuote);
}

export function isBigIntLiteralType(type: Type): type is BigIntLiteralType {
return !!(type.flags & TypeFlags.BigIntLiteral);
}

export function isConditionalType(type: Type): type is ConditionalType {
return !!(type.flags & TypeFlags.Conditional);
}

export function isIndexType(type: Type): type is IndexType {
return !!(type.flags & TypeFlags.Index);
}

export function isIndexedAccessType(type: Type): type is IndexedAccessType {
return !!(type.flags & TypeFlags.IndexedAccess);
}

export function isIntersectionType(type: Type): type is IntersectionType {
return !!(type.flags & TypeFlags.Intersection);
}

export function isNumberLiteralType(type: Type): type is NumberLiteralType {
return !!(type.flags & TypeFlags.NumberLiteral);
}

export function isObjectType(type: Type): type is ObjectType {
return !!(type.flags & TypeFlags.Object);
}

export function isStringMappingType(type: Type): type is StringMappingType {
return !!(type.flags & TypeFlags.StringMapping);
}

export function isSubstitutionType(type: Type): type is SubstitutionType {
return !!(type.flags & TypeFlags.Substitution);
}

export function isStringLiteralType(type: Type): type is StringLiteralType {
return !!(type.flags & TypeFlags.StringLiteral);
}

export function isTemplateLiteralType(type: Type): type is TemplateLiteralType {
return !!(type.flags & TypeFlags.TemplateLiteral);
}

export function isTypeParameterType(type: Type): type is TypeParameter {
return !!(type.flags & TypeFlags.TypeParameter);
}

export function isThisTypeParameter(type: Type): boolean {
return isTypeParameterType(type) && !!type.isThisType;
}

export function isTypeVariableType(type: Type): type is TypeVariable {
return !!(type.flags & TypeFlags.TypeVariable);
}

export function isUnionType(type: Type): type is UnionType {
return !!(type.flags & TypeFlags.Union);
}

export function isUnionOrIntersectionType(type: Type): type is IntersectionType | UnionType {
return !!(type.flags & TypeFlags.UnionOrIntersection);
}

export interface NodeModulePathParts {
readonly topLevelNodeModulesIndex: number;
readonly topLevelPackageNameIndex: number;
Expand Down

0 comments on commit 5e851e7

Please sign in to comment.