repository-provider 26.7.6 → 27.0.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/README.md CHANGED
@@ -198,13 +198,14 @@ console.log(await readme.getString());
198
198
  * [equals](#equals-3)
199
199
  * [Parameters](#parameters-50)
200
200
  * [displayName](#displayname)
201
+ * [fullName](#fullname-1)
201
202
  * [toJSON](#tojson-2)
202
203
  * [Project](#project)
203
204
  * [Parameters](#parameters-51)
204
205
  * [PullRequest](#pullrequest)
205
206
  * [Parameters](#parameters-52)
206
207
  * [Properties](#properties-7)
207
- * [fullName](#fullname-1)
208
+ * [fullName](#fullname-2)
208
209
  * [url](#url-2)
209
210
  * [repository](#repository-1)
210
211
  * [provider](#provider-2)
@@ -246,7 +247,7 @@ console.log(await readme.getString());
246
247
  * [entry](#entry)
247
248
  * [Parameters](#parameters-62)
248
249
  * [owner](#owner)
249
- * [fullName](#fullname-2)
250
+ * [fullName](#fullname-3)
250
251
  * [fullCondensedName](#fullcondensedname)
251
252
  * [identifier](#identifier-1)
252
253
  * [issuesURL](#issuesurl)
@@ -261,7 +262,6 @@ console.log(await readme.getString());
261
262
  * [RepositoryGroup](#repositorygroup-1)
262
263
  * [Parameters](#parameters-63)
263
264
  * [Properties](#properties-9)
264
- * [fullName](#fullname-3)
265
265
  * [attributeMapping](#attributemapping-1)
266
266
  * [type](#type)
267
267
  * [url](#url-3)
@@ -1189,6 +1189,10 @@ Beautified name use for human displaying only.
1189
1189
 
1190
1190
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** human readable name
1191
1191
 
1192
+ ### fullName
1193
+
1194
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
1195
+
1192
1196
  ### toJSON
1193
1197
 
1194
1198
  Provide name and all defined attributes.
@@ -1555,10 +1559,6 @@ Abstract repository collection.
1555
1559
  * `provider` **[BaseProvider](#baseprovider)**
1556
1560
  * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
1557
1561
 
1558
- ### fullName
1559
-
1560
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
1561
-
1562
1562
  ### attributeMapping
1563
1563
 
1564
1564
  Map attributes between external and internal representation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "26.7.6",
3
+ "version": "27.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/attribute.mjs CHANGED
@@ -6,6 +6,8 @@
6
6
  * @property {boolean} [private] should the value be shown
7
7
  * @property {string} description
8
8
  * @property {any} [default] the default value
9
+ * @property {Function} [set] set the value
10
+ * @property {Function} [get] get the value can be used to calculate default values
9
11
  * @property {string|string[]} [env] environment variable use to provide the value
10
12
  */
11
13
 
@@ -48,8 +50,8 @@ export function definePropertiesFromOptions(
48
50
  let value = getAttribute(options, name);
49
51
 
50
52
  if (value === undefined) {
51
- if (attribute.getDefault) {
52
- value = attribute.getDefault(attribute, object, properties);
53
+ if (attribute.get) {
54
+ value = attribute.get(attribute, object, properties);
53
55
  } else if (
54
56
  attribute.default !== undefined &&
55
57
  attribute.default !== getAttribute(object, name)
@@ -115,8 +117,11 @@ export function defaultValues(attributes, object) {
115
117
 
116
118
  if (attribute.default !== undefined) {
117
119
  a.push([name, attribute.default]);
118
- } else if (attribute.getDefault !== undefined) {
119
- a.push([name, attribute.getDefault(attribute, object)]);
120
+ } else if (attribute.get !== undefined) {
121
+ const value = attribute.get(attribute, object);
122
+ if(value !== undefined) {
123
+ a.push([name, value]);
124
+ }
120
125
  }
121
126
 
122
127
  return a;