copymitter 8.0.1 → 8.1.0

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/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ 2023.08.09, v8.1.0
2
+
3
+ feature:
4
+ - 20671e7 package: rimraf v5.0.1
5
+ - 643c877 package: c8 v8.0.1
6
+ - c2a65a3 package: eslint-plugin-putout v19.0.3
7
+ - e038810 package: putout v31.0.4
8
+ - fa90ae3 package: redzip v3.0.0
9
+
1
10
  2023.03.21, v8.0.1
2
11
 
3
12
  fix:
package/README.md CHANGED
@@ -18,11 +18,7 @@ const from = `${cwd}/pipe-io`;
18
18
  const to = `${cwd}/example`;
19
19
  const abortOnError = false;
20
20
 
21
- const cp = copymitter(from, to, [
22
- 'LICENSE',
23
- 'README.md',
24
- 'package.json',
25
- ]);
21
+ const cp = copymitter(from, to, ['LICENSE', 'README.md', 'package.json']);
26
22
 
27
23
  cp.on('file', (from, to) => {
28
24
  console.log(`${from} -> ${to}`);
package/lib/copymitter.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const isString = (a) => typeof a === 'string';
3
4
  const path = require('path');
4
5
  const {readlink} = require('fs/promises');
5
6
  const {inherits} = require('util');
@@ -124,6 +125,7 @@ Copymitter.prototype._cpAll = function() {
124
125
 
125
126
  const copyDir = async (from, to) => {
126
127
  const {mode} = await readStat(from);
128
+
127
129
  await write(to, null, {
128
130
  mode,
129
131
  });
@@ -241,13 +243,12 @@ Copymitter.prototype._progress = function() {
241
243
  };
242
244
 
243
245
  function check(from, to, files) {
244
- if (typeof from !== 'string')
246
+ if (!isString(from))
245
247
  throw Error('from should be a string!');
246
248
 
247
- if (typeof to !== 'string')
249
+ if (!isString(to))
248
250
  throw Error('to should be a string!');
249
251
 
250
252
  if (!Array.isArray(files))
251
253
  throw Error('files should be an array!');
252
254
  }
253
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copymitter",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "type": "commonjs",
5
5
  "description": "copy files with emitter",
6
6
  "main": "lib/copymitter.js",
@@ -21,7 +21,7 @@
21
21
  "findit2": "^2.2.3",
22
22
  "fullstore": "^3.0.0",
23
23
  "mkdirp": "^2.1.5",
24
- "redzip": "^2.0.0",
24
+ "redzip": "^3.0.0",
25
25
  "squad": "^3.0.0",
26
26
  "through2": "^4.0.2",
27
27
  "try-to-catch": "^3.0.0",
@@ -29,16 +29,16 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@iocmd/wait": "^2.1.0",
32
- "c8": "^7.5.0",
32
+ "c8": "^8.0.1",
33
33
  "eslint": "^8.25.0",
34
34
  "eslint-plugin-node": "^11.0.0",
35
- "eslint-plugin-putout": "^17.1.0",
35
+ "eslint-plugin-putout": "^19.0.3",
36
36
  "madrun": "^9.0.6",
37
37
  "mock-require": "^3.0.3",
38
38
  "nodemon": "^2.0.2",
39
39
  "pullout": "^4.0.0",
40
- "putout": "^29.1.5",
41
- "rimraf": "^4.4.0",
40
+ "putout": "^31.0.4",
41
+ "rimraf": "^5.0.1",
42
42
  "supertape": "^8.1.0",
43
43
  "try-catch": "^3.0.0"
44
44
  },