MCPcopy Create free account
hub / github.com/fa0311/TwitterInternalAPIDocument / search_js_reg

Function search_js_reg

lib/js_parser/js_parser.py:98–117  ·  view source on GitHub ↗
(text: js_data, search: str)

Source from the content-addressed store, hash-verified

96
97
98def search_js_reg(text: js_data, search: str) -> list[js_search_data]:
99 output = []
100 for data in text.children:
101 if type(data) is js_data:
102 output.extend(search_js_reg(data, search))
103 for key in range(len(text.children)):
104 data = text.children[key]
105 if type(data) is str:
106 find = re.findall(search, data)
107 for _ in range(len(find)):
108 output.append(js_search_data())
109 output[-1].children = text.children[key]
110 output[-1].parent = text
111 if len(text.children) > key + 1:
112 output[-1].after = text.children[key + 1]
113 if len(text.children) > 0:
114 output[-1].before = text.children[key - 1]
115 output[-1].data = find
116 break
117 return output
118
119
120def json_parser(text: js_data):

Callers 6

generator.pyFile · 0.85
get_dispatchFunction · 0.85
get_graphqlFunction · 0.85
marge_exportsFunction · 0.85
get_freeze_objectFunction · 0.85
get_feature_switchesFunction · 0.85

Calls 1

js_search_dataClass · 0.85

Tested by

no test coverage detected