@vltpkg/types 1.0.0-rc.24 → 1.0.0-rc.26
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/dist/index.d.ts +1 -0
- package/dist/index.js +16 -6
- package/package.json +7 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -116,11 +116,13 @@ export const parsePerson = (person, writeAccess, isPublisher) => {
|
|
|
116
116
|
const email = typeof person.email === 'string' ? person.email
|
|
117
117
|
: typeof person.mail === 'string' ? person.mail
|
|
118
118
|
: undefined;
|
|
119
|
-
|
|
119
|
+
const url = typeof person.url === 'string' ? person.url : undefined;
|
|
120
|
+
if (!name && !email && !url)
|
|
120
121
|
return undefined;
|
|
121
122
|
return {
|
|
122
123
|
name,
|
|
123
124
|
email,
|
|
125
|
+
...(url ? { url } : {}),
|
|
124
126
|
[kWriteAccess]: writeAccess ?? false,
|
|
125
127
|
[kIsPublisher]: isPublisher ?? false,
|
|
126
128
|
};
|
|
@@ -128,13 +130,16 @@ export const parsePerson = (person, writeAccess, isPublisher) => {
|
|
|
128
130
|
else if (typeof person === 'string') {
|
|
129
131
|
const NAME_PATTERN = /^([^(<]+)/;
|
|
130
132
|
const EMAIL_PATTERN = /<([^<>]+)>/;
|
|
133
|
+
const URL_PATTERN = /\(([^()]+)\)/;
|
|
131
134
|
const name = NAME_PATTERN.exec(person)?.[0].trim() || '';
|
|
132
135
|
const email = EMAIL_PATTERN.exec(person)?.[1] || '';
|
|
133
|
-
|
|
136
|
+
const url = URL_PATTERN.exec(person)?.[1] || '';
|
|
137
|
+
if (!name && !email && !url)
|
|
134
138
|
return undefined;
|
|
135
139
|
return {
|
|
136
140
|
name: name || undefined,
|
|
137
141
|
email: email || undefined,
|
|
142
|
+
...(url ? { url } : {}),
|
|
138
143
|
[kWriteAccess]: writeAccess ?? false,
|
|
139
144
|
[kIsPublisher]: isPublisher ?? false,
|
|
140
145
|
};
|
|
@@ -146,10 +151,15 @@ export const parsePerson = (person, writeAccess, isPublisher) => {
|
|
|
146
151
|
*/
|
|
147
152
|
export const isNormalizedContributorEntry = (o) => {
|
|
148
153
|
return (isObject(o) &&
|
|
149
|
-
typeof o.name === 'string'
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
(typeof o.name === 'string' ||
|
|
155
|
+
typeof o.email === 'string' ||
|
|
156
|
+
typeof o.url === 'string') &&
|
|
157
|
+
(typeof o.name === 'undefined' ||
|
|
158
|
+
(typeof o.name === 'string' && !!o.name)) &&
|
|
159
|
+
(typeof o.email === 'undefined' ||
|
|
160
|
+
(typeof o.email === 'string' && !!o.email)) &&
|
|
161
|
+
(typeof o.url === 'undefined' ||
|
|
162
|
+
(typeof o.url === 'string' && !!o.url)) &&
|
|
153
163
|
(isBoolean(o[kWriteAccess]) ||
|
|
154
164
|
isBoolean(o.writeAccess)) &&
|
|
155
165
|
(isBoolean(o[kIsPublisher]) ||
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/types",
|
|
3
3
|
"description": "definitions for some of vlt's core types",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.26",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
},
|
|
10
10
|
"author": {
|
|
11
11
|
"name": "vlt technology inc.",
|
|
12
|
-
"email": "support@vlt.sh"
|
|
12
|
+
"email": "support@vlt.sh",
|
|
13
|
+
"url": "http://vlt.sh"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"@vltpkg/dep-id": "1.0.0-rc.
|
|
16
|
-
"@vltpkg/error-cause": "1.0.0-rc.
|
|
17
|
-
"@vltpkg/semver": "1.0.0-rc.
|
|
18
|
-
"@vltpkg/spec": "1.0.0-rc.
|
|
16
|
+
"@vltpkg/dep-id": "1.0.0-rc.26",
|
|
17
|
+
"@vltpkg/error-cause": "1.0.0-rc.26",
|
|
18
|
+
"@vltpkg/semver": "1.0.0-rc.26",
|
|
19
|
+
"@vltpkg/spec": "1.0.0-rc.26"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@eslint/js": "^9.39.1",
|