Skip to content

Commit

Permalink
feat: use @npmcli/redact for url cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 3, 2024
1 parent e58e8bc commit 228f1e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/check-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const errors = require('./errors.js')
const { Response } = require('minipass-fetch')
const defaultOpts = require('./default-opts.js')
const log = require('proc-log')
const cleanUrl = require('./clean-url.js')
const { redact: cleanUrl } = require('@npmcli/redact')

/* eslint-disable-next-line max-len */
const moreInfoUrl = 'https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry'
Expand Down
27 changes: 0 additions & 27 deletions lib/clean-url.js

This file was deleted.

5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const qs = require('querystring')
const url = require('url')
const zlib = require('minizlib')
const { Minipass } = require('minipass')
const { redact: cleanUrl } = require('@npmcli/redact')

const defaultOpts = require('./default-opts.js')

Expand Down Expand Up @@ -246,4 +247,6 @@ function getHeaders (uri, auth, opts) {
return headers
}

module.exports.cleanUrl = require('./clean-url.js')
// export cleanUrl to avoid a breaking change
// TODO: next semver major remove this. Consumers should use @npmcli/redact instead
module.exports.cleanUrl = cleanUrl
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"author": "GitHub Inc.",
"license": "ISC",
"dependencies": {
"@npmcli/redact": "^0.0.0",
"make-fetch-happen": "^13.0.0",
"minipass": "^7.0.2",
"minipass-fetch": "^3.0.0",
Expand Down

0 comments on commit 228f1e6

Please sign in to comment.