Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 18, 2022
1 parent c42f53b commit dc4ef69
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v1
if: matrix.node-version == 14
- uses: codecov/codecov-action@v2
if: matrix.node-version == 16
with:
fail_ci_if_error: true
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default function normalizeUrl(urlString, options) {

// Remove query unwanted parameters
if (Array.isArray(options.removeQueryParameters)) {
// eslint-disable-next-line unicorn/no-useless-spread -- We are intentionally spreading to get a copy.
for (const key of [...urlObject.searchParams.keys()]) {
if (testParameter(key, options.removeQueryParameters)) {
urlObject.searchParams.delete(key);
Expand Down
2 changes: 1 addition & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ normalizeUrl('http://sindresorhus.com:80/', {forceHttps: true});
normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
normalizeUrl('https://sindresorhus.com', {stripProtocol: true});
normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
normalizeUrl('http://www.sindresorhus.com', {stripWWW: false}); // eslint-disable-line @typescript-eslint/naming-convention
normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
removeQueryParameters: ['ref', /test/],
});
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"node": ">=12.20"
},
"scripts": {
"test": "xo && c8 ava && tsd"
"test": "ava && tsd"
},
"files": [
"index.js",
Expand All @@ -38,11 +38,10 @@
"canonical"
],
"devDependencies": {
"ava": "^3.15.0",
"c8": "^7.7.3",
"tsd": "^0.17.0",
"typescript": "^4.3.5",
"xo": "^0.41.0"
"ava": "^4.0.1",
"c8": "^7.11.0",
"tsd": "^0.19.1",
"xo": "^0.47.0"
},
"c8": {
"reporter": [
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.

## Install

```
$ npm install normalize-url
```sh
npm install normalize-url
```

*If you need to use this in the browser, use version 4: `npm i normalize-url@4`*
Expand Down

0 comments on commit dc4ef69

Please sign in to comment.