@lxf2513/readdir-sync-recursive
Advanced tools
+2
-5
@@ -19,3 +19,2 @@ 'use strict'; | ||
| const readdirResults = []; | ||
| const pathsQueue = [path]; | ||
| function readdir(dirpath) { | ||
@@ -31,3 +30,3 @@ try { | ||
| if (isDirectory(resultPath)) { | ||
| pathsQueue.push(resultPath); | ||
| readdir(resultPath); | ||
| } | ||
@@ -39,5 +38,3 @@ } | ||
| } | ||
| for (let i = 0; i < pathsQueue.length; i++) { | ||
| readdir(pathsQueue[i]); | ||
| } | ||
| readdir(path); | ||
| return readdirResults; | ||
@@ -44,0 +41,0 @@ } |
+2
-5
@@ -17,3 +17,2 @@ import { statSync, readdirSync } from 'node:fs'; | ||
| const readdirResults = []; | ||
| const pathsQueue = [path]; | ||
| function readdir(dirpath) { | ||
@@ -29,3 +28,3 @@ try { | ||
| if (isDirectory(resultPath)) { | ||
| pathsQueue.push(resultPath); | ||
| readdir(resultPath); | ||
| } | ||
@@ -37,5 +36,3 @@ } | ||
| } | ||
| for (let i = 0; i < pathsQueue.length; i++) { | ||
| readdir(pathsQueue[i]); | ||
| } | ||
| readdir(path); | ||
| return readdirResults; | ||
@@ -42,0 +39,0 @@ } |
+2
-2
| { | ||
| "name": "@lxf2513/readdir-sync-recursive", | ||
| "version": "1.2.1", | ||
| "version": "1.2.2", | ||
| "description": "Reads the contents of the directory synchronously and recursively.", | ||
@@ -51,3 +51,3 @@ "type": "module", | ||
| "@types/node": "^22.10.1", | ||
| "prettier": "^3.4.1", | ||
| "prettier": "^3.4.2", | ||
| "typescript": "^5.7.2", | ||
@@ -54,0 +54,0 @@ "unbuild": "^2.0.0" |
5758
-3.36%75
-7.41%