ocket8888 opened a new pull request, #7344:
URL: https://github.com/apache/trafficcontrol/pull/7344

   This PR adds an HTTP interceptor to TPv2 that parses JSON responses with a 
special "reviver" function that converts strings-representing-dates into actual 
`Date` instances. This eliminates the need to do so by hand e.g.
   
   ```typescript
   const resp = await this.get<MyType>("my/type");
   return resp.map(
       m => ({...m, lastUpdated: new Date((m.lastUpdated as unknown as 
string).replace(" ", "T").replace("+00", "Z"))})
   );
   ```
   
   <hr/>
   
   ## Which Traffic Control components are affected by this PR?
   - Traffic Portal (experimental v2)
   
   ## What is the best way to verify this PR?
   Make sure the provided tests pass.
   
   ## PR submission checklist
   - [x] This PR has tests
   - [x] This PR doesn't need documentation
   - [x] This PR doesn't need a CHANGELOG.md entry 
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to