repository-provider 32.7.9 → 32.7.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider)
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
- [![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/?q=repository-provider)
3
+ [![bundlejs](https://deno.bundlejs.com/?q=repository-provider\&badge=detailed)](https://bundlejs.com/?q=repository-provider)
4
4
  [![downloads](http://img.shields.io/npm/dm/repository-provider.svg?style=flat-square)](https://npmjs.org/package/repository-provider)
5
5
  [![GitHub Issues](https://img.shields.io/github/issues/arlac77/repository-provider.svg?style=flat-square)](https://github.com/arlac77/repository-provider/issues)
6
6
  [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Frepository-provider%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/repository-provider/goto)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "32.7.9",
3
+ "version": "32.7.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,10 +32,6 @@ export function definePropertiesFromOptions(
32
32
  const applyLater = {};
33
33
 
34
34
  Object.entries(attributes).forEach(([name, attribute]) => {
35
- const path = name.split(/\./);
36
- const first = path.shift();
37
- const property = properties[first];
38
-
39
35
  let value = getAttribute(options, name);
40
36
 
41
37
  if (value === undefined) {
@@ -67,8 +63,13 @@ export function definePropertiesFromOptions(
67
63
  }
68
64
  }
69
65
 
66
+ const path = name.split(/\./);
67
+ const first = path.shift();
68
+ const property = properties[first];
69
+
70
70
  if (path.length) {
71
71
  const remaining = path.join(".");
72
+
72
73
  if (property) {
73
74
  setAttribute(property.value, remaining, value);
74
75
  } else {
@@ -4,11 +4,12 @@ import {
4
4
  } from "./attribute-extras.mjs";
5
5
  import { description_attribute, id_attribute } from "./attributes.mjs";
6
6
 
7
- /**
8
- * @param {Object} options
9
- * @param {Object} additionalProperties
10
- */
11
- export class BaseObject {
7
+ /**
8
+ * Creates an instance of BaseObject.
9
+ * @param {Object|undefined} options
10
+ * @param {Object|undefined} additionalProperties
11
+ */
12
+ export class BaseObject {
12
13
  /**
13
14
  * @return {string} type we represent
14
15
  */
@@ -56,18 +57,13 @@ export class BaseObject {
56
57
  return {};
57
58
  }
58
59
 
59
- /**
60
- * Creates an instance of BaseObject.
61
- * @param {Object} options
62
- * @param {Object} additionalProperties
63
- */
64
60
  constructor(options, additionalProperties) {
65
61
  this.updateAttributes(options, additionalProperties);
66
62
  }
67
63
 
68
64
  /**
69
65
  * Takes values from options.
70
- * @param {Object} options
66
+ * @param {Object|undefined} options
71
67
  */
72
68
  updateAttributes(options, additionalProperties) {
73
69
  definePropertiesFromOptions(
@@ -12,7 +12,8 @@ import {
12
12
  url_attribute,
13
13
  name_attribute,
14
14
  description_attribute,
15
- priority_attribute
15
+ priority_attribute,
16
+ default_attribute
16
17
  } from "./attributes.mjs";
17
18
 
18
19
  /**
@@ -119,9 +120,9 @@ export class BaseProvider extends BaseObject {
119
120
  * To forward info/warn and error messages to
120
121
  */
121
122
  messageDestination: {
123
+ ...default_attribute,
122
124
  type: "object",
123
125
  default: console,
124
- mandatory: false,
125
126
  writable: true,
126
127
  private: true
127
128
  }
@@ -300,7 +301,7 @@ export class BaseProvider extends BaseObject {
300
301
  * List provider objects of a given type.
301
302
  *
302
303
  * @param {string} type name of the method to deliver typed iterator projects,milestones,hooks,repositories,branches,tags
303
- * @param {string|string[]} patterns group / repository filter
304
+ * @param {string[]|string} patterns group / repository filter
304
305
  */
305
306
  async *list(type, patterns) {
306
307
  if (patterns === undefined) {
package/src/branch.mjs CHANGED
@@ -201,7 +201,7 @@ export class Branch extends Ref {
201
201
  * Create a new {@link Branch} by cloning a given source branch.
202
202
  * Simply calls Repository.createBranch() with the receiver as source branch
203
203
  * @param {string} name the new branch
204
- * @param {Object|undefined} options
204
+ * @param {Object|undefined} options passed through
205
205
  * @return {Promise<Branch>} newly created branch (or already present old one with the same name)
206
206
  */
207
207
  async createBranch(name, options) {
@@ -1,11 +1,12 @@
1
1
  import { matcher } from "matching-iterator";
2
2
  import { Branch } from "./branch.mjs";
3
3
  import { Repository } from "./repository.mjs";
4
+ import { NamedObject } from "./named-object.mjs";
4
5
  import { asArray, stripBaseName, stripBaseNames } from "./util.mjs";
5
6
 
6
7
  /**
7
8
  * Mixin to define a class able to handle a collection of repositories.
8
- * @param {Class} base to be extendet
9
+ * @param {Object} base to be extendet
9
10
  */
10
11
  export function RepositoryOwner(base) {
11
12
  return class RepositoryOwner extends base {
@@ -108,7 +109,7 @@ export function RepositoryOwner(base) {
108
109
  /**
109
110
  * List entities for a given type and pattern.
110
111
  * @param {string} type
111
- * @param {string|string[]} patterns
112
+ * @param {string[]|string} patterns
112
113
  * @param {function} [split]
113
114
  * @param {Object} [defaultItem]
114
115
  * @return {AsyncIterator<NamedObject>} matching type and pattern
@@ -23,7 +23,7 @@ import {
23
23
  * @class Repository
24
24
  * @param {RepositoryOwner} owner
25
25
  * @param {string} name (#branch) will be removed
26
- * @param {Object} options
26
+ * @param {Object|undefined} options
27
27
  * @param {string} [options.description] human readable description
28
28
  * @param {string} [options.id] internal id
29
29
  *
@@ -362,7 +362,7 @@ export class Repository extends OwnedObject {
362
362
  }
363
363
 
364
364
  /**
365
- * The @{link PullRequest} for a given name.
365
+ * The @see {@link PullRequest} for a given name.
366
366
  * @param {string} name
367
367
  * @return {Promise<PullRequest>}
368
368
  */
@@ -465,7 +465,7 @@ export class Repository extends OwnedObject {
465
465
  /**
466
466
  * Get sha of a ref.
467
467
  * @param {string} ref
468
- * @return {Promise<string>} sha of the ref
468
+ * @return {Promise<string|undefined>} sha of the ref
469
469
  */
470
470
  async refId(ref) {}
471
471