Skip to content

Commit b2a4942

Browse files
wraithgarnlf
authored andcommitted
1 parent 9555a5f commit b2a4942

File tree

22 files changed

+92
-809
lines changed

22 files changed

+92
-809
lines changed

node_modules/normalize-package-data/AUTHORS

Lines changed: 0 additions & 4 deletions
This file was deleted.

node_modules/normalize-package-data/lib/fixer.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var extractDescription = require('./extract_description')
88
var url = require('url')
99
var typos = require('./typos.json')
1010

11+
var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.'))
12+
1113
module.exports = {
1214
// default warning function
1315
warn: function () {},
@@ -127,7 +129,7 @@ module.exports = {
127129
if (!data.dependencies) {
128130
data.dependencies = {}
129131
}
130-
if (Object.prototype.hasOwnProperty.call(data.dependencies, bd)) {
132+
if (!Object.prototype.hasOwnProperty.call(data.dependencies, bd)) {
131133
this.warn('nonDependencyBundleDependency', bd)
132134
data.dependencies[bd] = '*'
133135
}
@@ -213,7 +215,7 @@ module.exports = {
213215

214216
fixNameField: function (data, options) {
215217
if (typeof options === 'boolean') {
216-
options = {strict: options}
218+
options = { strict: options }
217219
} else if (typeof options === 'undefined') {
218220
options = {}
219221
}
@@ -261,16 +263,15 @@ module.exports = {
261263
if (!data.bugs && data.repository && data.repository.url) {
262264
var hosted = hostedGitInfo.fromUrl(data.repository.url)
263265
if (hosted && hosted.bugs()) {
264-
data.bugs = {url: hosted.bugs()}
266+
data.bugs = { url: hosted.bugs() }
265267
}
266268
} else if (data.bugs) {
267-
var emailRe = /^.+@.*\..+$/
268269
if (typeof data.bugs === 'string') {
269-
if (emailRe.test(data.bugs)) {
270-
data.bugs = {email: data.bugs}
270+
if (isEmail(data.bugs)) {
271+
data.bugs = { email: data.bugs }
271272
/* eslint-disable-next-line node/no-deprecated-api */
272273
} else if (url.parse(data.bugs).protocol) {
273-
data.bugs = {url: data.bugs}
274+
data.bugs = { url: data.bugs }
274275
} else {
275276
this.warn('nonEmailUrlBugsString')
276277
}
@@ -287,7 +288,7 @@ module.exports = {
287288
}
288289
}
289290
if (oldBugs.email) {
290-
if (typeof (oldBugs.email) === 'string' && emailRe.test(oldBugs.email)) {
291+
if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) {
291292
data.bugs.email = oldBugs.email
292293
} else {
293294
this.warn('nonEmailBugsEmailField')
@@ -399,8 +400,8 @@ function parsePerson (person) {
399400
return person
400401
}
401402
var name = person.match(/^([^(<]+)/)
402-
var url = person.match(/\(([^)]+)\)/)
403-
var email = person.match(/<([^>]+)>/)
403+
var url = person.match(/\(([^()]+)\)/)
404+
var email = person.match(/<([^<>]+)>/)
404405
var obj = {}
405406
if (name && name[0].trim()) {
406407
obj.name = name[0].trim()
Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "normalize-package-data",
3-
"version": "3.0.3",
4-
"author": "Meryn Stol <[email protected]>",
3+
"version": "4.0.0",
4+
"author": "GitHub Inc.",
55
"description": "Normalizes data that can be found in package.json files.",
66
"license": "BSD-2-Clause",
77
"repository": {
@@ -13,29 +13,40 @@
1313
"postversion": "npm publish",
1414
"prepublishOnly": "git push origin --follow-tags",
1515
"preversion": "npm test",
16-
"test": "tap test/*.js --branches 85 --functions 90 --lines 85 --statements 85",
16+
"test": "tap",
1717
"npmclilint": "npmcli-lint",
18-
"lint": "npm run npmclilint -- \"lib/**/*.*js\" \"test/**/*.*js\"",
18+
"lint": "eslint '**/*.js'",
1919
"lintfix": "npm run lint -- --fix",
20-
"posttest": "npm run lint --",
21-
"postsnap": "npm run lintfix --"
20+
"posttest": "npm run lint",
21+
"postsnap": "npm run lintfix --",
22+
"postlint": "npm-template-check",
23+
"template-copy": "npm-template-copy --force",
24+
"snap": "tap"
2225
},
2326
"dependencies": {
24-
"hosted-git-info": "^4.0.1",
25-
"is-core-module": "^2.5.0",
26-
"semver": "^7.3.4",
27-
"validate-npm-package-license": "^3.0.1"
27+
"hosted-git-info": "^5.0.0",
28+
"is-core-module": "^2.8.1",
29+
"semver": "^7.3.5",
30+
"validate-npm-package-license": "^3.0.4"
2831
},
2932
"devDependencies": {
30-
"@npmcli/lint": "^1.0.2",
33+
"@npmcli/template-oss": "^2.9.2",
3134
"tap": "^15.0.9"
3235
},
3336
"files": [
34-
"lib/*.js",
35-
"lib/*.json",
36-
"AUTHORS"
37+
"bin",
38+
"lib"
3739
],
3840
"engines": {
39-
"node": ">=10"
41+
"node": "^12.13.0 || ^14.15.0 || >=16"
42+
},
43+
"templateOSS": {
44+
"version": "2.9.2"
45+
},
46+
"tap": {
47+
"branches": 86,
48+
"functions": 92,
49+
"lines": 86,
50+
"statements": 86
4051
}
4152
}

node_modules/read-package-json/node_modules/normalize-package-data/LICENSE

Lines changed: 0 additions & 15 deletions
This file was deleted.

node_modules/read-package-json/node_modules/normalize-package-data/lib/extract_description.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)