Skip to content

Commit

Permalink
url: improve isURL detection
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#47886
Backport-PR-URL: nodejs/node#50105
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent 50e8653 commit be42fed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions graal-nodejs/test/parallel/test-url-is-url.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit be42fed

Please sign in to comment.