From be42fed379ee77842cef2a2b72b6ac84f8a419cd Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Thu, 25 Apr 2024 04:23:09 +0200 Subject: [PATCH] url: improve `isURL` detection PR-URL: https://github.com/nodejs/node/pull/47886 Backport-PR-URL: https://github.com/nodejs/node/pull/50105 Reviewed-By: Rich Trott Reviewed-By: Matthew Aitken Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca --- graal-nodejs/test/parallel/test-url-is-url.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 graal-nodejs/test/parallel/test-url-is-url.js diff --git a/graal-nodejs/test/parallel/test-url-is-url.js b/graal-nodejs/test/parallel/test-url-is-url.js new file mode 100644 index 00000000000..0b42bb3b2f2 --- /dev/null +++ b/graal-nodejs/test/parallel/test-url-is-url.js @@ -0,0 +1,11 @@ +// Flags: --expose-internals +'use strict'; + +require('../common'); + +const { URL, parse } = require('url'); +const assert = require('assert'); +const { isURL } = require('internal/url'); + +assert.strictEqual(isURL(new URL('https://www.nodejs.org')), true); +assert.strictEqual(isURL(parse('https://www.nodejs.org')), false);