repository-provider 30.0.1 → 30.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/package.json +2 -2
- package/src/attribute.mjs +2 -2
- package/src/base-provider.mjs +4 -8
- package/src/hook.mjs +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"ava": "^4.2.0",
|
|
37
37
|
"c8": "^7.11.3",
|
|
38
38
|
"documentation": "^13.2.5",
|
|
39
|
-
"repository-provider-test-support": "^2.1.
|
|
39
|
+
"repository-provider-test-support": "^2.1.20",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
41
|
"typescript": "^4.7.2"
|
|
42
42
|
},
|
package/src/attribute.mjs
CHANGED
|
@@ -193,7 +193,7 @@ export function optionJSON(
|
|
|
193
193
|
initial = {},
|
|
194
194
|
attributes = object.constructor.attributes
|
|
195
195
|
) {
|
|
196
|
-
return Object.keys(attributes
|
|
196
|
+
return attributes ? Object.keys(attributes).reduce((a, c) => {
|
|
197
197
|
const value = object[c];
|
|
198
198
|
if (value !== undefined && !(value instanceof Function)) {
|
|
199
199
|
if (value instanceof Set) {
|
|
@@ -203,7 +203,7 @@ export function optionJSON(
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return a;
|
|
206
|
-
}, initial);
|
|
206
|
+
}, initial) : initial;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/**
|
package/src/base-provider.mjs
CHANGED
|
@@ -192,7 +192,7 @@ export class BaseProvider extends BaseObject {
|
|
|
192
192
|
* @return {string} normalized name
|
|
193
193
|
*/
|
|
194
194
|
normalizeGroupName(name, forLookup) {
|
|
195
|
-
const { group } = this.parseName(name,
|
|
195
|
+
const { group } = this.parseName(name, "group");
|
|
196
196
|
return group && forLookup && !this.areGroupNamesCaseSensitive
|
|
197
197
|
? group.toLowerCase()
|
|
198
198
|
: group;
|
|
@@ -239,10 +239,10 @@ export class BaseProvider extends BaseObject {
|
|
|
239
239
|
* Parses repository name and tries to split it into
|
|
240
240
|
* base, group, repository and branch.
|
|
241
241
|
* @param {string} name
|
|
242
|
-
* @param {
|
|
242
|
+
* @param {string} focus where lies the focus if only one path component is given
|
|
243
243
|
* @return {Object} with separated attributes
|
|
244
244
|
*/
|
|
245
|
-
parseName(name,
|
|
245
|
+
parseName(name, focus = "repository") {
|
|
246
246
|
const result = {};
|
|
247
247
|
|
|
248
248
|
if (name === undefined) {
|
|
@@ -286,11 +286,7 @@ export class BaseProvider extends BaseObject {
|
|
|
286
286
|
result.group = parts[i];
|
|
287
287
|
result.repository = parts[i + 1];
|
|
288
288
|
} else {
|
|
289
|
-
|
|
290
|
-
result.group = name;
|
|
291
|
-
} else {
|
|
292
|
-
result.repository = name;
|
|
293
|
-
}
|
|
289
|
+
result[focus] = name;
|
|
294
290
|
}
|
|
295
291
|
}
|
|
296
292
|
|
package/src/hook.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { optionJSON } from "./attribute.mjs";
|
|
2
1
|
import { OwnedObject } from "./owned-object.mjs";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -20,11 +19,4 @@ export class Hook extends OwnedObject {
|
|
|
20
19
|
static get addMethodName() {
|
|
21
20
|
return "_addHook";
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Provide name, events and all defined attributes.
|
|
26
|
-
*/
|
|
27
|
-
toJSON() {
|
|
28
|
-
return optionJSON(this, { name: this.name, id: this.id });
|
|
29
|
-
}
|
|
30
22
|
}
|