parseCollectionItems = (items = [], currentPath) => {
        items.forEach(async (item) => {
          if (['http-request', 'graphql-request'].includes(item.type)) {
            let sanitizedFilename = sanitizeName(item?.filename || `${item.name}.bru`);
            const content = await jsonToBruViaWorker(item);
            const filePath = path.join(currentPath, sanitizedFilename);
            safeWriteFileSync(filePath, content);
          }
          if (item.type === 'folder') {
            let sanitizedFolderName = sanitizeName(item?.filename || item?.name);
            const folderPath = path.join(currentPath, sanitizedFolderName);
            fs.mkdirSync(folderPath);

            if (item?.root?.meta?.name) {
              const folderBruFilePath = path.join(folderPath, 'folder.bru');
              item.root.meta.seq = item.seq;
              const folderContent = await jsonToCollectionBru(
                item.root,
                true // isFolder
              );
              safeWriteFileSync(folderBruFilePath, folderContent);
            }

            if (item.items && item.items.length) {
              parseCollectionItems(item.items, folderPath);
            }
          }
          // Handle items of type 'js'
          if (item.type === 'js') {
            let sanitizedFilename = sanitizeName(item?.filename || `${item.name}.js`);
            const filePath = path.join(currentPath, sanitizedFilename);
            safeWriteFileSync(filePath, item.fileContent);
          }
        });
      }
If it is windows OS
And it is not a WSL path (meaning it is not running in WSL (linux pathtype))
And it has sub directories
Only then we need to use the temp dir approach to rename the folder

Windows OS would sometimes throw error when renaming a folder with sub directories
This is an alternative approach to avoid that error