date.ts 196 B

12345678
  1. // Date 是宿主对象,不是纯数据 —— 拒绝。
  2. interface WithDate {
  3. createdAt: Date;
  4. }
  5. const g = agent("g");
  6. const v = await g.ask<WithDate>("go"); // error
  7. log(JSON.stringify(v));