symbol-bigint.ts 310 B

123456789101112
  1. // symbol 与 bigint 不可 JSON 序列化 —— 拒绝。
  2. interface WithSymbol {
  3. tag: symbol;
  4. }
  5. interface WithBigInt {
  6. huge: bigint;
  7. }
  8. const g = agent("g");
  9. const a = await g.ask<WithSymbol>("sym"); // error
  10. const b = await g.ask<WithBigInt>("big"); // error
  11. log(JSON.stringify(a) + JSON.stringify(b));