npm-pkgbuild 22.0.5 → 22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "22.0.5",
3
+ "version": "22.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -137,7 +137,7 @@ export class ALPM extends Packager {
137
137
  default: ["any"],
138
138
  mandatory: true
139
139
  },
140
- backup: { ...string_collection_attribute_writable, name: "backup" },
140
+ backup: { ...string_collection_attribute_writable, name: "backup", skipEmpty: true },
141
141
  depends: {
142
142
  ...dependency_attribute_collection_writable /*, alias: "dependencies" */,
143
143
  name: "depends"
@@ -279,7 +279,7 @@ package() {
279
279
  expander
280
280
  )) {
281
281
  const flags = {
282
- user: ["-u", value => value],
282
+ user: ["-o", value => value],
283
283
  group: ["-g", value => value],
284
284
  mode: ["-m", value => Number(value & 0o7777).toString(8)]
285
285
  };
@@ -287,7 +287,6 @@ export const dependency_type = {
287
287
  toExternal: (value, attribute) => {
288
288
  switch (typeof value) {
289
289
  case "string":
290
- return value;
291
290
  case "undefined":
292
291
  return value;
293
292
  }
package/src/util.mjs CHANGED
@@ -154,11 +154,17 @@ export function fieldProvider(properties, attributes) {
154
154
  for (const [name, attribute] of Object.entries(attributes)) {
155
155
  if (!presentKeys.has(name)) {
156
156
  let value = properties[attribute.alias || name];
157
- if (value === undefined) {
157
+ if (
158
+ value === undefined ||
159
+ (attribute.collection && value.size === 0)
160
+ ) {
158
161
  if (attribute.default === undefined) {
159
162
  if (attribute.mandatory) {
160
163
  console.error(`Missing value for mandatory attribute ${name}`);
161
164
  }
165
+ if (attribute.skipEmplty) {
166
+ continue;
167
+ }
162
168
  } else {
163
169
  yield [name, toExternal(attribute.default, attribute)];
164
170
  }