From 52f2290b19d9ec1f17e6e69201ac6ed1dcde346f Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 4 Nov 2022 14:58:45 +0700 Subject: [PATCH] Require Node.js 14 --- index.d.ts | 4 ++-- package.json | 15 +++++++++------ test.js | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index 2bd85e8..d9e1635 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -export interface Options { +export type Options = { /** @default 'http:' @@ -280,7 +280,7 @@ export interface Options { ``` */ readonly sortQueryParameters?: boolean; -} +}; /** [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL. diff --git a/package.json b/package.json index 5688d35..d65a755 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,12 @@ "url": "https://sindresorhus.com" }, "type": "module", - "exports": "./index.js", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, "engines": { - "node": ">=12.20" + "node": ">=14.16" }, "scripts": { "test": "xo && c8 ava && tsd" @@ -38,10 +41,10 @@ "canonical" ], "devDependencies": { - "ava": "^4.0.1", - "c8": "^7.11.0", - "tsd": "^0.19.1", - "xo": "^0.47.0" + "ava": "^5.0.1", + "c8": "^7.12.0", + "tsd": "^0.24.1", + "xo": "^0.52.4" }, "c8": { "reporter": [ diff --git a/test.js b/test.js index 9b80824..454f724 100644 --- a/test.js +++ b/test.js @@ -406,4 +406,5 @@ test('ignore custom schemes', t => { t.is(normalizeUrl('tel:004346382763'), 'tel:004346382763'); t.is(normalizeUrl('mailto:office@foo.com'), 'mailto:office@foo.com'); t.is(normalizeUrl('sindre://www.sindresorhus.com'), 'sindre://www.sindresorhus.com'); + t.is(normalizeUrl('foo:bar'), 'foo:bar'); });