Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't need isJSON here #1399

Merged
merged 5 commits into from
Oct 15, 2019
Merged

don't need isJSON here #1399

merged 5 commits into from
Oct 15, 2019

Conversation

tinovyatkin
Copy link
Contributor

@tinovyatkin tinovyatkin commented Oct 14, 2019

The logic at response.length is almost completely repeats whole is-json module content. Adding just one more comparison to Stream will eliminate need for external dependency that basically repeats the same checks - so, it's both more performant and safe.

@codecov
Copy link

codecov bot commented Oct 14, 2019

Codecov Report

Merging #1399 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1399      +/-   ##
==========================================
- Coverage   99.36%   99.36%   -0.01%     
==========================================
  Files           4        4              
  Lines         476      474       -2     
  Branches      125      124       -1     
==========================================
- Hits          473      471       -2     
  Partials        3        3
Impacted Files Coverage Δ
lib/response.js 99.36% <100%> (-0.01%) ⬇️

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 d48d88e...639f5b2. Read the comment docs.

lib/response.js Outdated Show resolved Hide resolved
@dead-horse dead-horse merged commit 4f96829 into koajs:master Oct 15, 2019
@tinovyatkin tinovyatkin deleted the dont-need-is-json-here branch October 15, 2019 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants