virtual-code-owners 8.2.2 → 8.2.3
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.
|
@@ -53,19 +53,15 @@ function expandTeamsToUsersString(pUsers, pTeamMap) {
|
|
|
53
53
|
.join(" ");
|
|
54
54
|
}
|
|
55
55
|
function expandTeamToUserNames(pUser, pTeamMap) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return [pUser.raw];
|
|
56
|
+
return pUser.type === "virtual-team-name"
|
|
57
|
+
? stringifyTeamMembers(pTeamMap, pUser.bareName)
|
|
58
|
+
: [pUser.raw];
|
|
60
59
|
}
|
|
61
60
|
function stringifyTeamMembers(pTeamMap, pTeamName) {
|
|
62
61
|
return (pTeamMap[pTeamName] ?? []).map(userNameToCodeOwner);
|
|
63
62
|
}
|
|
64
63
|
function userNameToCodeOwner(pUserName) {
|
|
65
|
-
|
|
66
|
-
return pUserName;
|
|
67
|
-
}
|
|
68
|
-
return `@${pUserName}`;
|
|
64
|
+
return isEmailIshUsername(pUserName) ? pUserName : `@${pUserName}`;
|
|
69
65
|
}
|
|
70
66
|
function compareUserNames(pLeftName, pRightName) {
|
|
71
67
|
return pLeftName.toLowerCase() > pRightName.toLowerCase() ? 1 : -1;
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "8.2.
|
|
1
|
+
export const VERSION = "8.2.3";
|
|
@@ -116,8 +116,5 @@ function getUserNameType(pUserName, pBareName, pTeamMap) {
|
|
|
116
116
|
return "invalid";
|
|
117
117
|
}
|
|
118
118
|
function getBareUserName(pUserName) {
|
|
119
|
-
|
|
120
|
-
return pUserName.slice(1);
|
|
121
|
-
}
|
|
122
|
-
return pUserName;
|
|
119
|
+
return pUserName.startsWith("@") ? pUserName.slice(1) : pUserName;
|
|
123
120
|
}
|
|
@@ -23,15 +23,11 @@ export default function readVirtualCodeOwners(
|
|
|
23
23
|
}
|
|
24
24
|
function reportAnomalies(pFileName, pAnomalies) {
|
|
25
25
|
return pAnomalies
|
|
26
|
-
.map((pAnomaly) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`It should either start with "@" or be an e-mail address.`
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
})
|
|
26
|
+
.map((pAnomaly) =>
|
|
27
|
+
pAnomaly.type === "invalid-line"
|
|
28
|
+
? `${pFileName}:${pAnomaly.line}:1 invalid line - neither a rule, section heading, comment nor empty: "${pAnomaly.raw}"`
|
|
29
|
+
: `${pFileName}:${pAnomaly.line}:1 invalid user or team name "${pAnomaly.raw}" (#${pAnomaly.userNumberWithinLine} on this line). ` +
|
|
30
|
+
`It should either start with "@" or be an e-mail address.`,
|
|
31
|
+
)
|
|
36
32
|
.join(EOL);
|
|
37
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-code-owners",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "CODEOWNERS with teams for teams that can't use GitHub teams",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"url": "https://github.com/sverweij/virtual-code-owners/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"yaml": "^2.
|
|
29
|
+
"yaml": "^2.6.1"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": "^18.11.0||>=20.0.0"
|