@@ -22,77 +22,24 @@ export type {
2222}
2323
2424// Type guards for each query node type
25- export function isRawConfigQuery ( query : QueryIR ) : query is QueryIR & { raw_config : RawConfig } {
26- return query . raw_config != null ;
27- }
28-
29- export function isRegexpQuery ( query : QueryIR ) : query is QueryIR & { regexp : Regexp } {
30- return query . regexp != null ;
31- }
32-
33- export function isSymbolQuery ( query : QueryIR ) : query is QueryIR & { symbol : Symbol } {
34- return query . symbol != null ;
35- }
36-
37- export function isLanguageQuery ( query : QueryIR ) : query is QueryIR & { language : Language } {
38- return query . language != null ;
39- }
40-
41- export function isConstQuery ( query : QueryIR ) : query is QueryIR & { const : boolean } {
42- return query . const != null ;
43- }
44-
45- export function isRepoQuery ( query : QueryIR ) : query is QueryIR & { repo : Repo } {
46- return query . repo != null ;
47- }
48-
49- export function isRepoRegexpQuery ( query : QueryIR ) : query is QueryIR & { repo_regexp : RepoRegexp } {
50- return query . repo_regexp != null ;
51- }
52-
53- export function isBranchesReposQuery ( query : QueryIR ) : query is QueryIR & { branches_repos : BranchesRepos } {
54- return query . branches_repos != null ;
55- }
56-
57- export function isRepoIdsQuery ( query : QueryIR ) : query is QueryIR & { repo_ids : RepoIds } {
58- return query . repo_ids != null ;
59- }
60-
61- export function isRepoSetQuery ( query : QueryIR ) : query is QueryIR & { repo_set : RepoSet } {
62- return query . repo_set != null ;
63- }
64-
65- export function isFileNameSetQuery ( query : QueryIR ) : query is QueryIR & { file_name_set : FileNameSet } {
66- return query . file_name_set != null ;
67- }
68-
69- export function isTypeQuery ( query : QueryIR ) : query is QueryIR & { type : Type } {
70- return query . type != null ;
71- }
72-
73- export function isSubstringQuery ( query : QueryIR ) : query is QueryIR & { substring : Substring } {
74- return query . substring != null ;
75- }
76-
77- export function isAndQuery ( query : QueryIR ) : query is QueryIR & { and : And } {
78- return query . and != null ;
79- }
80-
81- export function isOrQuery ( query : QueryIR ) : query is QueryIR & { or : Or } {
82- return query . or != null ;
83- }
84-
85- export function isNotQuery ( query : QueryIR ) : query is QueryIR & { not : Not } {
86- return query . not != null ;
87- }
88-
89- export function isBranchQuery ( query : QueryIR ) : query is QueryIR & { branch : Branch } {
90- return query . branch != null ;
91- }
92-
93- export function isBoostQuery ( query : QueryIR ) : query is QueryIR & { boost : Boost } {
94- return query . boost != null ;
95- }
25+ export const isRawConfigQuery = ( query : QueryIR ) : query is QueryIR & { raw_config : RawConfig } => query . raw_config != null ;
26+ export const isRegexpQuery = ( query : QueryIR ) : query is QueryIR & { regexp : Regexp } => query . regexp != null ;
27+ export const isSymbolQuery = ( query : QueryIR ) : query is QueryIR & { symbol : Symbol } => query . symbol != null ;
28+ export const isLanguageQuery = ( query : QueryIR ) : query is QueryIR & { language : Language } => query . language != null ;
29+ export const isConstQuery = ( query : QueryIR ) : query is QueryIR & { const : boolean } => query . const != null ;
30+ export const isRepoQuery = ( query : QueryIR ) : query is QueryIR & { repo : Repo } => query . repo != null ;
31+ export const isRepoRegexpQuery = ( query : QueryIR ) : query is QueryIR & { repo_regexp : RepoRegexp } => query . repo_regexp != null ;
32+ export const isBranchesReposQuery = ( query : QueryIR ) : query is QueryIR & { branches_repos : BranchesRepos } => query . branches_repos != null ;
33+ export const isRepoIdsQuery = ( query : QueryIR ) : query is QueryIR & { repo_ids : RepoIds } => query . repo_ids != null ;
34+ export const isRepoSetQuery = ( query : QueryIR ) : query is QueryIR & { repo_set : RepoSet } => query . repo_set != null ;
35+ export const isFileNameSetQuery = ( query : QueryIR ) : query is QueryIR & { file_name_set : FileNameSet } => query . file_name_set != null ;
36+ export const isTypeQuery = ( query : QueryIR ) : query is QueryIR & { type : Type } => query . type != null ;
37+ export const isSubstringQuery = ( query : QueryIR ) : query is QueryIR & { substring : Substring } => query . substring != null ;
38+ export const isAndQuery = ( query : QueryIR ) : query is QueryIR & { and : And } => query . and != null ;
39+ export const isOrQuery = ( query : QueryIR ) : query is QueryIR & { or : Or } => query . or != null ;
40+ export const isNotQuery = ( query : QueryIR ) : query is QueryIR & { not : Not } => query . not != null ;
41+ export const isBranchQuery = ( query : QueryIR ) : query is QueryIR & { branch : Branch } => query . branch != null ;
42+ export const isBoostQuery = ( query : QueryIR ) : query is QueryIR & { boost : Boost } => query . boost != null ;
9643
9744/**
9845 * Visitor pattern for traversing a QueryIR tree.
0 commit comments