Skip to content

Commit

Permalink
feat(node): add URL export (denoland/deno#7132)
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton authored and caspervonb committed Jan 31, 2021
1 parent 5db129c commit 4ecf03f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const newlineRegEx = /\n/g;
const carriageReturnRegEx = /\r/g;
const tabRegEx = /\t/g;

const _url = URL;
export { _url as URL };

export function fileURLToPath(path: string | URL): string {
if (typeof path === "string") path = new URL(path);
else if (!(path instanceof URL)) {
Expand Down
9 changes: 9 additions & 0 deletions node/url_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { assertEquals } from "../testing/asserts.ts";
import * as url from "./url.ts";

Deno.test({
name: "[url] URL",
fn() {
assertEquals(url.URL, URL);
},
});

0 comments on commit 4ecf03f

Please sign in to comment.