MCPcopy Index your code
hub / github.com/fa0311/TwitterInternalAPIDocument / search_js

Function search_js

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

Source from the content-addressed store, hash-verified

76
77
78def search_js(text: js_data, search: str) -> list[js_search_data]:
79 output = []
80 for data in text.children:
81 if type(data) is js_data:
82 output.extend(search_js(data, search))
83 for key in range(len(text.children)):
84 data = text.children[key]
85 if data == search:
86 output.append(js_search_data())
87 output[-1].children = text.children
88 output[-1].parent = text
89 if len(text.children) > key + 1:
90 output[-1].after = text.children[key + 1]
91 if len(text.children) > 0:
92 output[-1].before = text.children[key - 1]
93 output[-1].data = search
94 break
95 return output
96
97
98def search_js_reg(text: js_data, search: str) -> list[js_search_data]:

Callers 2

generator.pyFile · 0.85
marge_exportsFunction · 0.85

Calls 1

js_search_dataClass · 0.85

Tested by

no test coverage detected