node icon indicating copy to clipboard operation
node copied to clipboard

os: expose `guessFileDescriptorType`

Open vladfrangu opened this issue 8 months ago • 3 comments

Exposes the internal guessHandleType function, which can be used to see if a handle has a specific type, regardless of the OS it is on.

This helps out with detecting, for example, if standard input is piped into the process, instead of relying on file system calls.

Refs: https://github.com/nodejs/node/issues/57603

vladfrangu avatar Apr 28 '25 08:04 vladfrangu

I'll rebase to fix the first commit message after the CI passes! Should I also squash the PR or leave the rest as is?

vladfrangu avatar Apr 29 '25 13:04 vladfrangu

Should I also squash the PR or leave the rest as is?

As you prefer, in any case it will get squashed upon merging.

aduh95 avatar Apr 29 '25 13:04 aduh95

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.21%. Comparing base (a36981a) to head (f3d0b71). Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/node_util.cc 89.47% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58060      +/-   ##
==========================================
- Coverage   90.21%   90.21%   -0.01%     
==========================================
  Files         630      630              
  Lines      186391   186392       +1     
  Branches    36608    36619      +11     
==========================================
- Hits       168161   168156       -5     
- Misses      11052    11060       +8     
+ Partials     7178     7176       -2     
Files with missing lines Coverage Δ
lib/internal/util.js 96.22% <100.00%> (+0.12%) :arrow_up:
lib/os.js 98.59% <100.00%> (+<0.01%) :arrow_up:
src/node_util.cc 82.33% <89.47%> (+0.54%) :arrow_up:

... and 23 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 29 '25 15:04 codecov[bot]