serve-static
serve-static copied to clipboard
perf: optimize collapseLeadingSlashes function
This pull request refactors the collapseLeadingSlashes function in index.js to improve readability and performance by simplifying the loop and replacing substr with slice.
Code readability and performance improvements:
index.js: Simplified thecollapseLeadingSlashesfunction by combining the loop condition and increment into a single line, and replaced the deprecatedsubstrmethod with the more modernslicemethod for better compatibility.