You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
888 B
23 lines
888 B
import re
|
|
with open("src/api/api.ts", encoding="utf-8") as f:
|
|
lines = f.readlines()
|
|
|
|
func_re = re.compile(r"^\s*(?:export\s+)?(?:async\s+)?function\s+(\w+)\s*\((.*?)\)\s*:")
|
|
req_re = re.compile(r"request(?:<[^>]*>)?\(")
|
|
|
|
targets = ["fetchConversations","fetchNotifications","fetchInterviews","fetchMatchResult",
|
|
"fetchResume","fetchFavorites","fetchJobProgress","fetchJobPreference","saveJobPreference",
|
|
"fetchCandidateDetail","fetchInterviewScore","fetchInterviewScoreDraft","fetchConversation",
|
|
"fetchRankData"]
|
|
|
|
cur=None; sig=None
|
|
for i,ln in enumerate(lines):
|
|
m=func_re.match(ln)
|
|
if m:
|
|
cur=m.group(1); sig=m.group(2)
|
|
if cur in targets:
|
|
if req_re.search(ln):
|
|
print(f"--- {cur}({sig.strip()}) line {i+1}")
|
|
print(" ", ln.rstrip())
|
|
# also catch request spanning: unlikely
|
|
print("\nDONE")
|
|
|