npm-pkgbuild 7.3.6 → 7.3.7

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/package.json +2 -2
  2. package/src/util.mjs +7 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "7.3.6",
3
+ "version": "7.3.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -46,7 +46,7 @@
46
46
  "expression-expander": "^7.0.9",
47
47
  "globby": "^12.0.2",
48
48
  "iterable-string-interceptor": "^1.0.8",
49
- "key-value-transformer": "^1.0.0",
49
+ "key-value-transformer": "^1.1.0",
50
50
  "npm-packlist": "^3.0.0",
51
51
  "pacote": "^12.0.2",
52
52
  "pkg-dir": "^6.0.1",
package/src/util.mjs CHANGED
@@ -63,27 +63,24 @@ export function extractFromPackage(pkg) {
63
63
 
64
64
  /**
65
65
  * Copy content from source into destinationDirectory
66
- * @param {AsyncIterator<ContentEntry>} source
67
- * @param {string} destinationDirectory
66
+ * @param {AsyncIterator<ContentEntry>} source
67
+ * @param {string} destinationDirectory
68
+ * @param {Transformer[]} transformers
68
69
  */
69
- async function copyEntries(source, destinationDirectory, transformers) {
70
+ export async function copyEntries(source, destinationDirectory, transformers) {
70
71
  for await (const entry of source) {
71
72
  const destName = join(destinationDirectory, entry.name);
72
73
 
73
74
  await mkdir(dirname(destName), { recursive: true });
74
75
 
75
- for(const t of transformers) {
76
- if(t.match(entry)) {
76
+ for (const t of transformers) {
77
+ if (t.match(entry)) {
77
78
  t.transform(entry);
78
79
 
79
80
  break;
80
81
  }
81
82
  }
82
83
 
83
- if (entry.name === "DEBIAN/control") {
84
- debianControlEntry = entry;
85
- } else {
86
- await pipeline(await entry.readStream, createWriteStream(destName));
87
- }
84
+ await pipeline(await entry.readStream, createWriteStream(destName));
88
85
  }
89
86
  }