mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

Fixes: https://github.com/nodejs/node/issues/48921 PR-URL: https://github.com/nodejs/node/pull/48928 Fixes: https://github.com/getsentry/sentry-javascript/issues/8552 Fixes: https://github.com/request/request/issues/3458 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
16 lines
427 B
JavaScript
16 lines
427 B
JavaScript
// 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);
|
|
assert.strictEqual(isURL({
|
|
href: 'https://www.nodejs.org',
|
|
protocol: 'https:',
|
|
path: '/',
|
|
}), false);
|