Unverified Commit a019d7bd authored by Ruben Bridgewater's avatar Ruben Bridgewater
Browse files

path: refactor more path code for simplicity

1) Consolidate format to a single function.
2) Move some code that can only be reached in some code branches
   that was formerly executed in all cases.
3) Explicitly check for the string length of zero instead of
   converting the string to a boolean.
4) Consolidate nested if statements if possible e.g.,
     if (foo) { if (bar) { /* do stuff */ } }
   to reduce indentation depth.
5) Simplify checks by removing extra length checks when comparing
   two strings.
6) Use object shorthand notation where possible.

PR-URL: https://github.com/nodejs/node/pull/25278


Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
parent 9d19b1f8
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment