@reliverse/relifso 1.2.8 → 1.2.9

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.
Files changed (2) hide show
  1. package/bin/impl/copy.js +7 -1
  2. package/package.json +2 -1
package/bin/impl/copy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { copyFileSync, statSync, constants as fsConstants } from "node:fs";
2
- import { stat as statAsync, copyFile as copyFileAsync, constants as fsConstantsAsync } from "node:fs/promises";
2
+ import { stat as statAsync, copyFile as copyFileAsync, constants as fsConstantsAsync, readdir } from "node:fs/promises";
3
3
  import { dirname, join as joinPath, basename as basenamePath } from "node:path";
4
4
  import { mkdirsSync } from "./mkdirs.js";
5
5
  import { mkdirs } from "./mkdirs.js";
@@ -55,6 +55,12 @@ export async function copy(src, dest, options = {}) {
55
55
  await mkdirs(destDir);
56
56
  if (srcStat?.isDirectory()) {
57
57
  await mkdirs(destFinal);
58
+ const entries = await readdir(src);
59
+ for (const entry of entries) {
60
+ const srcEntry = joinPath(src, entry);
61
+ const destEntry = joinPath(destFinal, entry);
62
+ await copy(srcEntry, destEntry, options);
63
+ }
58
64
  } else {
59
65
  await copyFileAsync(src, destFinal, preserveTimestamps ? fsConstantsAsync.COPYFILE_FICLONE : 0);
60
66
  if (preserveTimestamps) {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "license": "MIT",
6
6
  "name": "@reliverse/relifso",
7
7
  "type": "module",
8
- "version": "1.2.8",
8
+ "version": "1.2.9",
9
9
  "keywords": [
10
10
  "fs",
11
11
  "file",
@@ -36,6 +36,7 @@
36
36
  "@cspotcode/source-map-support": "^0.8.1",
37
37
  "@eslint/js": "^9.27.0",
38
38
  "@reliverse/dler": "^1.3.6",
39
+ "@reliverse/pathkit": "^1.0.4",
39
40
  "@rollup/plugin-alias": "^5.1.1",
40
41
  "@rollup/plugin-babel": "^6.0.4",
41
42
  "@rollup/plugin-commonjs": "^28.0.3",