Skip to content

Commit

Permalink
deps: normalize-package-data@4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar authored and nlf committed Mar 15, 2022
1 parent 9555a5f commit b2a4942
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 809 deletions.
4 changes: 0 additions & 4 deletions node_modules/normalize-package-data/AUTHORS

This file was deleted.

21 changes: 11 additions & 10 deletions node_modules/normalize-package-data/lib/fixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var extractDescription = require('./extract_description')
var url = require('url')
var typos = require('./typos.json')

var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.'))

module.exports = {
// default warning function
warn: function () {},
Expand Down Expand Up @@ -127,7 +129,7 @@ module.exports = {
if (!data.dependencies) {
data.dependencies = {}
}
if (Object.prototype.hasOwnProperty.call(data.dependencies, bd)) {
if (!Object.prototype.hasOwnProperty.call(data.dependencies, bd)) {
this.warn('nonDependencyBundleDependency', bd)
data.dependencies[bd] = '*'
}
Expand Down Expand Up @@ -213,7 +215,7 @@ module.exports = {

fixNameField: function (data, options) {
if (typeof options === 'boolean') {
options = {strict: options}
options = { strict: options }
} else if (typeof options === 'undefined') {
options = {}
}
Expand Down Expand Up @@ -261,16 +263,15 @@ module.exports = {
if (!data.bugs && data.repository && data.repository.url) {
var hosted = hostedGitInfo.fromUrl(data.repository.url)
if (hosted && hosted.bugs()) {
data.bugs = {url: hosted.bugs()}
data.bugs = { url: hosted.bugs() }
}
} else if (data.bugs) {
var emailRe = /^.+@.*\..+$/
if (typeof data.bugs === 'string') {
if (emailRe.test(data.bugs)) {
data.bugs = {email: data.bugs}
if (isEmail(data.bugs)) {
data.bugs = { email: data.bugs }
/* eslint-disable-next-line node/no-deprecated-api */
} else if (url.parse(data.bugs).protocol) {
data.bugs = {url: data.bugs}
data.bugs = { url: data.bugs }
} else {
this.warn('nonEmailUrlBugsString')
}
Expand All @@ -287,7 +288,7 @@ module.exports = {
}
}
if (oldBugs.email) {
if (typeof (oldBugs.email) === 'string' && emailRe.test(oldBugs.email)) {
if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) {
data.bugs.email = oldBugs.email
} else {
this.warn('nonEmailBugsEmailField')
Expand Down Expand Up @@ -399,8 +400,8 @@ function parsePerson (person) {
return person
}
var name = person.match(/^([^(<]+)/)
var url = person.match(/\(([^)]+)\)/)
var email = person.match(/<([^>]+)>/)
var url = person.match(/\(([^()]+)\)/)
var email = person.match(/<([^<>]+)>/)
var obj = {}
if (name && name[0].trim()) {
obj.name = name[0].trim()
Expand Down
41 changes: 26 additions & 15 deletions node_modules/normalize-package-data/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "normalize-package-data",
"version": "3.0.3",
"author": "Meryn Stol <merynstol@gmail.com>",
"version": "4.0.0",
"author": "GitHub Inc.",
"description": "Normalizes data that can be found in package.json files.",
"license": "BSD-2-Clause",
"repository": {
Expand All @@ -13,29 +13,40 @@
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"preversion": "npm test",
"test": "tap test/*.js --branches 85 --functions 90 --lines 85 --statements 85",
"test": "tap",
"npmclilint": "npmcli-lint",
"lint": "npm run npmclilint -- \"lib/**/*.*js\" \"test/**/*.*js\"",
"lint": "eslint '**/*.js'",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint --",
"postsnap": "npm run lintfix --"
"posttest": "npm run lint",
"postsnap": "npm run lintfix --",
"postlint": "npm-template-check",
"template-copy": "npm-template-copy --force",
"snap": "tap"
},
"dependencies": {
"hosted-git-info": "^4.0.1",
"is-core-module": "^2.5.0",
"semver": "^7.3.4",
"validate-npm-package-license": "^3.0.1"
"hosted-git-info": "^5.0.0",
"is-core-module": "^2.8.1",
"semver": "^7.3.5",
"validate-npm-package-license": "^3.0.4"
},
"devDependencies": {
"@npmcli/lint": "^1.0.2",
"@npmcli/template-oss": "^2.9.2",
"tap": "^15.0.9"
},
"files": [
"lib/*.js",
"lib/*.json",
"AUTHORS"
"bin",
"lib"
],
"engines": {
"node": ">=10"
"node": "^12.13.0 || ^14.15.0 || >=16"
},
"templateOSS": {
"version": "2.9.2"
},
"tap": {
"branches": 86,
"functions": 92,
"lines": 86,
"statements": 86
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit b2a4942

Please sign in to comment.