(from)
| 73 | const toJsonWasCalled = new WeakSet(); |
| 74 | |
| 75 | const toJSON = (from) => { |
| 76 | toJsonWasCalled.add(from); |
| 77 | const json = from.toJSON(); |
| 78 | toJsonWasCalled.delete(from); |
| 79 | return json; |
| 80 | }; |
| 81 | |
| 82 | const getErrorConstructor = (name) => errorConstructors.get(name) ?? Error; |
| 83 |