(self, with_key=True)
| 478 | rewrite_by: 'JsonObject' = None # 在 solve override 时最近的 rewrite 来源('!!' 标记)同时也会从父节点向子节点传播 |
| 479 | |
| 480 | def dump_json(self, with_key=True) -> str: |
| 481 | result = f'"{self.key}": ' if self.key and with_key else "" |
| 482 | |
| 483 | if self.is_dict and type(self.val) is list: |
| 484 | result += f"{{{', '.join([child.dump_json() for child in self.val])}}}" |
| 485 | elif type(self.val) is list: |
| 486 | result += f"[{', '.join([child.dump_json() for child in self.val])}]" |
| 487 | elif type(self.val) is str: |
| 488 | result += f'"{self.val}"' |
| 489 | else: |
| 490 | result += f"{self.val}" |
| 491 | |
| 492 | return result |
| 493 | |
| 494 | def make_log_stack(self, end_key: str = None) -> t.List[log.LogStack]: |
| 495 | result = [] |
no test coverage detected