lupine.api 1.1.47 → 1.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.api",
3
- "version": "1.1.47",
3
+ "version": "1.1.48",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://github.com/uuware/lupine.js",
@@ -124,21 +124,21 @@ export class FsUtils {
124
124
  };
125
125
  private static getDirsFullpathDepthSub = async (dirPath: string, depth = 0, maxDepth = 1): Promise<Dirent[]> => {
126
126
  try {
127
+ const ret = [];
127
128
  const files = await fs.readdir(dirPath, {
128
129
  recursive: false,
129
130
  withFileTypes: true,
130
131
  });
132
+ ret.push(...files);
131
133
  if (depth + 1 < maxDepth) {
132
134
  for (const entry of files) {
133
135
  if (entry.isDirectory()) {
134
- if (depth < maxDepth) {
135
- const fullPath = path.join(dirPath, entry.name);
136
- (entry as any).sub = await this.getDirsFullpathDepthSub(fullPath, depth + 1, maxDepth);
137
- }
136
+ const fullPath = path.join(dirPath, entry.name);
137
+ ret.push(...(await this.getDirsFullpathDepthSub(fullPath, depth + 1, maxDepth)));
138
138
  }
139
139
  }
140
140
  }
141
- return files;
141
+ return ret;
142
142
  } catch {
143
143
  return [];
144
144
  }