@@ -5,7 +5,6 @@ var hostedGitInfo = require('hosted-git-info')
55var { isBuiltin } = require ( 'node:module' )
66var depTypes = [ 'dependencies' , 'devDependencies' , 'optionalDependencies' ]
77var extractDescription = require ( './extract_description' )
8- var url = require ( 'url' )
98var typos = require ( './typos.json' )
109
1110var isEmail = str => str . includes ( '@' ) && ( str . indexOf ( '@' ) < str . lastIndexOf ( '.' ) )
@@ -269,8 +268,7 @@ module.exports = {
269268 if ( typeof data . bugs === 'string' ) {
270269 if ( isEmail ( data . bugs ) ) {
271270 data . bugs = { email : data . bugs }
272- /* eslint-disable-next-line node/no-deprecated-api */
273- } else if ( url . parse ( data . bugs ) . protocol ) {
271+ } else if ( URL . canParse ( data . bugs ) ) {
274272 data . bugs = { url : data . bugs }
275273 } else {
276274 this . warn ( 'nonEmailUrlBugsString' )
@@ -280,8 +278,7 @@ module.exports = {
280278 var oldBugs = data . bugs
281279 data . bugs = { }
282280 if ( oldBugs . url ) {
283- /* eslint-disable-next-line node/no-deprecated-api */
284- if ( typeof ( oldBugs . url ) === 'string' && url . parse ( oldBugs . url ) . protocol ) {
281+ if ( URL . canParse ( oldBugs . url ) ) {
285282 data . bugs . url = oldBugs . url
286283 } else {
287284 this . warn ( 'nonUrlBugsUrlField' )
@@ -317,8 +314,7 @@ module.exports = {
317314 this . warn ( 'nonUrlHomepage' )
318315 return delete data . homepage
319316 }
320- /* eslint-disable-next-line node/no-deprecated-api */
321- if ( ! url . parse ( data . homepage ) . protocol ) {
317+ if ( ! URL . canParse ( data . homepage ) ) {
322318 data . homepage = 'http://' + data . homepage
323319 }
324320 } ,
0 commit comments