| 55 | |
| 56 | |
| 57 | class js_search_data: |
| 58 | def __init__(self): |
| 59 | self.children: list = [] |
| 60 | self.parent: js_data = None |
| 61 | self.after = None |
| 62 | self.before = None |
| 63 | self.data = None |
| 64 | |
| 65 | def __repr__(self): |
| 66 | return json.dumps(self.children) |
| 67 | |
| 68 | def to_list(self): |
| 69 | output = [] |
| 70 | for child in self.children: |
| 71 | if type(child) is js_data: |
| 72 | output.append(child.to_list()) |
| 73 | else: |
| 74 | output.append(child) |
| 75 | return output |
| 76 | |
| 77 | |
| 78 | def search_js(text: js_data, search: str) -> list[js_search_data]: |
no outgoing calls
no test coverage detected