Performance: path.extname for file extensions
LOW IMPACT
This affects the speed of extracting file extensions during file path processing, impacting script execution time.
const ext = path.extname(filename);
const ext = filename.split('.').pop();| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| String.split + pop | 0 | 0 | 0 | [X] Bad |
| path.extname | 0 | 0 | 0 | [OK] Good |