Commit 2ac1038
committed
feat(@probitas/probitas): add custom serializer for IPC step values
Standard JSON.stringify fails on BigInt, circular references, Symbol,
Function, Map, Set, RegExp, TypedArray, and other JavaScript types.
This causes step context values to be lost or corrupted when passed
between processes via IPC.
The custom serializer uses a marker object pattern ($type property)
to preserve type information across the IPC boundary, enabling steps
to receive BigInt, Map, circular references, and other complex values
through ctx.previous and ctx.results.
Handles: BigInt, Symbol, Function, undefined, circular references,
Map, Set, WeakMap, WeakSet, RegExp, Date, Error, TypedArray,
ArrayBuffer, DataView, WeakRef.
Addresses #801 parent ccc57f6 commit 2ac1038
3 files changed
Lines changed: 968 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
170 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
171 | 178 | | |
172 | 179 | | |
173 | 180 | | |
| |||
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
200 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
201 | 214 | | |
202 | 215 | | |
203 | 216 | | |
| |||
0 commit comments