digitalbazaar / http-client

An opinionated, isomorphic HTTP client.
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

Always set response `data` field. #25

Closed davidlehn closed 2 years ago

davidlehn commented 2 years ago

Always set response data field and default to undefined. Addresses issue when a non-JSON response is receieved, a caller accesses the data field, and a lower level library prints out a one-time warning to use other fields.

codecov-commenter commented 2 years ago

Codecov Report

Merging #25 (053eb5c) into update-dependencies (4eed7a8) will increase coverage by 0.09%. The diff coverage is 100.00%.

@@                   Coverage Diff                   @@
##           update-dependencies      #25      +/-   ##
=======================================================
+ Coverage                95.17%   95.27%   +0.09%     
=======================================================
  Files                        2        2              
  Lines                      145      148       +3     
=======================================================
+ Hits                       138      141       +3     
  Misses                       7        7              
Impacted Files Coverage Δ
lib/httpClient.js 94.92% <100.00%> (+0.11%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4eed7a8...053eb5c. Read the comment docs.