npm-pkgbuild 22.0.5 → 22.1.1

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/README.md CHANGED
@@ -348,6 +348,9 @@ Source of package content.
348
348
  ### Properties
349
349
 
350
350
  * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
351
+ * `destination` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
352
+ * `defaultProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
353
+ * `permissions` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>**&#x20;
351
354
 
352
355
  ### propertiesFor
353
356
 
@@ -356,7 +359,7 @@ Source of package content.
356
359
  * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
357
360
  * `isCollection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
358
361
 
359
- Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))**&#x20;
362
+ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
360
363
 
361
364
  ### asyncIterator
362
365
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "22.0.5",
3
+ "version": "22.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -137,7 +137,11 @@ 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: {
141
+ ...string_collection_attribute_writable,
142
+ name: "backup",
143
+ skipEmpty: true
144
+ },
141
145
  depends: {
142
146
  ...dependency_attribute_collection_writable /*, alias: "dependencies" */,
143
147
  name: "depends"
@@ -156,10 +160,15 @@ export class ALPM extends Packager {
156
160
  },
157
161
  conflicts: {
158
162
  ...dependency_attribute_collection_writable,
159
- name: "conflicts"
163
+ name: "conflicts",
164
+ skipEmpty: true
160
165
  },
161
166
  provides: { ...dependency_attribute_collection_writable, name: "provides" },
162
- replaces: { ...dependency_attribute_collection_writable, name: "replaces" },
167
+ replaces: {
168
+ ...dependency_attribute_collection_writable,
169
+ name: "replaces",
170
+ skipEmpty: true
171
+ },
163
172
  options: { ...default_attribute, name: "options" }
164
173
  };
165
174
 
@@ -241,7 +250,6 @@ package() {
241
250
 
242
251
  if [ "$(ls -A $srcdir)" ]
243
252
  then
244
- #cp -rp $srcdir/* "$pkgdir"
245
253
  ### PERMISSION ###
246
254
 
247
255
  ${verbose}
@@ -279,7 +287,7 @@ package() {
279
287
  expander
280
288
  )) {
281
289
  const flags = {
282
- user: ["-u", value => value],
290
+ user: ["-o", value => value],
283
291
  group: ["-g", value => value],
284
292
  mode: ["-m", value => Number(value & 0o7777).toString(8)]
285
293
  };
@@ -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
  }