(file, encoding, errors, **kwargs)
| 35 | |
| 36 | |
| 37 | def _to_json(file, encoding, errors, **kwargs): |
| 38 | try: |
| 39 | return Box.from_json(filename=file, encoding=encoding, errors=errors, **kwargs) |
| 40 | except JSONDecodeError: |
| 41 | raise BoxError("File is not JSON as expected") |
| 42 | except BoxError: |
| 43 | return BoxList.from_json(filename=file, encoding=encoding, errors=errors, **kwargs) |
| 44 | |
| 45 | |
| 46 | def _to_csv(file, encoding, errors, **kwargs): |