npm-pkgbuild 22.1.9 → 22.1.10

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": "npm-pkgbuild",
3
- "version": "22.1.9",
3
+ "version": "22.1.10",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
package/src/publish.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { basename } from "node:path";
2
2
  import { createReadStream } from "node:fs";
3
3
  import { mkdir, copyFile } from "node:fs/promises";
4
+ import { asArray } from "pacc";
4
5
  import { decodePassword } from "./util.mjs";
5
6
 
6
7
  /**
@@ -22,8 +23,8 @@ import { decodePassword } from "./util.mjs";
22
23
  * @param {string} [properties.username]
23
24
  * @return {PublishingDetail[]}
24
25
  */
25
- export function createPublishingDetails(locations = [], properties) {
26
- locations = [...locations];
26
+ export function createPublishingDetails(locations, properties) {
27
+ locations = asArray(locations);
27
28
 
28
29
  let publishPropertyFound = false;
29
30
 
@@ -150,7 +151,8 @@ export async function publish(
150
151
 
151
152
  if (!response.ok) {
152
153
  throw new Error(
153
- `Unable to publish to ${url}: ${response.statusText}(${response.status})`, { cause: response }
154
+ `Unable to publish to ${url}: ${response.statusText}(${response.status})`,
155
+ { cause: response }
154
156
  );
155
157
  }
156
158
  }
package/src/util.mjs CHANGED
@@ -162,7 +162,7 @@ export function fieldProvider(properties, attributes) {
162
162
  if (attribute.mandatory) {
163
163
  console.error(`Missing value for mandatory attribute ${name}`);
164
164
  }
165
- if (attribute.skipEmplty) {
165
+ if (attribute.skipEmpty) {
166
166
  continue;
167
167
  }
168
168
  } else {
@@ -171,7 +171,7 @@ export function fieldProvider(properties, attributes) {
171
171
  } else {
172
172
  if (attribute.mapping) {
173
173
  const mappedValue = attribute.mapping[value];
174
- if (mappedValue) {
174
+ if (mappedValue !== undefined) {
175
175
  value = mappedValue;
176
176
  }
177
177
  }