« get me outta code hell

Revert "sugar: wrapQueue, use this in traverse" - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/node-utils.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-12-20 19:47:17 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-12-20 19:47:17 -0400
commit4b6de9bc45ec840ebda44c62f66f601a70a211cd (patch)
tree0f0d717e17bd5284af88950fe9e475136640201b /src/node-utils.js
parent73fcf6c666273af5d7bf31338dc3b8ec0af58ad5 (diff)
Revert "sugar: wrapQueue, use this in traverse"
This reverts commit ab038ee9aa304c7127ffd9832b236fb2a7a7a787.
Diffstat (limited to 'src/node-utils.js')
-rw-r--r--src/node-utils.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/node-utils.js b/src/node-utils.js
index d2e29b2f..345d10aa 100644
--- a/src/node-utils.js
+++ b/src/node-utils.js
@@ -6,8 +6,6 @@ import {fileURLToPath} from 'node:url';
 
 import _commandExists from 'command-exists';
 
-import {wrapQueue} from '#sugar';
-
 // This package throws an error instead of returning false when the command
 // doesn't exist, for some reason. Yay for making logic more difficult!
 // Here's a straightforward workaround.
@@ -70,7 +68,6 @@ export async function traverse(rootPath, {
   filterFile = () => true,
   filterDir = () => true,
   prefixPath = rootPath,
-  queueSize = 8,
 } = {}) {
   const pathJoinDevice = path.join;
   const pathJoinStyle = {
@@ -83,8 +80,6 @@ export async function traverse(rootPath, {
     throw new Error(`Expected pathStyle to be device, posix, or win32`);
   }
 
-  const q_readdir = wrapQueue(readdir, queueSize);
-
   const recursive = (names, ...subdirectories) =>
     Promise.all(names.map(async name => {
       const devicePath = pathJoinDevice(rootPath, ...subdirectories, name);
@@ -95,7 +90,7 @@ export async function traverse(rootPath, {
       else if (!stats.isDirectory() && !stats.isFile()) return [];
 
       if (stats.isDirectory()) {
-        return recursive(await q_readdir(devicePath), ...subdirectories, name);
+        return recursive(await readdir(devicePath), ...subdirectories, name);
       } else {
         return pathJoinStyle(prefixPath, ...subdirectories, name);
       }