mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
Revert "feat(runtime): support urls for Deno.realPath
and Deno.realPathSync
(#10626)"
This reverts commit 910935c071
.
This commit is contained in:
parent
94eabfeeba
commit
6d63167420
3 changed files with 4 additions and 21 deletions
4
cli/dts/lib.deno.ns.d.ts
vendored
4
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -1467,7 +1467,7 @@ declare namespace Deno {
|
|||
* Requires `allow-read` permission for the target path.
|
||||
* Also requires `allow-read` permission for the CWD if the target path is
|
||||
* relative.*/
|
||||
export function realPathSync(path: string | URL): string;
|
||||
export function realPathSync(path: string): string;
|
||||
|
||||
/** Resolves to the absolute normalized path, with symbolic links resolved.
|
||||
*
|
||||
|
@ -1483,7 +1483,7 @@ declare namespace Deno {
|
|||
* Requires `allow-read` permission for the target path.
|
||||
* Also requires `allow-read` permission for the CWD if the target path is
|
||||
* relative.*/
|
||||
export function realPath(path: string | URL): Promise<string>;
|
||||
export function realPath(path: string): Promise<string>;
|
||||
|
||||
export interface DirEntry {
|
||||
name: string;
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
assertMatch,
|
||||
assertThrows,
|
||||
assertThrowsAsync,
|
||||
pathToAbsoluteFileUrl,
|
||||
unitTest,
|
||||
} from "./test_util.ts";
|
||||
|
||||
|
@ -21,12 +19,6 @@ unitTest({ perms: { read: true } }, function realPathSyncSuccess(): void {
|
|||
}
|
||||
});
|
||||
|
||||
unitTest({ perms: { read: true } }, function realPathSyncUrl(): void {
|
||||
const relative = "cli/tests/fixture.json";
|
||||
const url = pathToAbsoluteFileUrl(relative);
|
||||
assertEquals(Deno.realPathSync(relative), Deno.realPathSync(url));
|
||||
});
|
||||
|
||||
unitTest(
|
||||
{
|
||||
perms: { read: true, write: true },
|
||||
|
@ -74,15 +66,6 @@ unitTest({ perms: { read: true } }, async function realPathSuccess(): Promise<
|
|||
}
|
||||
});
|
||||
|
||||
unitTest(
|
||||
{ perms: { read: true } },
|
||||
async function realPathUrl(): Promise<void> {
|
||||
const relative = "cli/tests/fixture.json";
|
||||
const url = pathToAbsoluteFileUrl(relative);
|
||||
assertEquals(await Deno.realPath(relative), await Deno.realPath(url));
|
||||
},
|
||||
);
|
||||
|
||||
unitTest(
|
||||
{
|
||||
perms: { read: true, write: true },
|
||||
|
|
|
@ -128,11 +128,11 @@
|
|||
}
|
||||
|
||||
function realPathSync(path) {
|
||||
return core.opSync("op_realpath_sync", pathFromURL(path));
|
||||
return core.opSync("op_realpath_sync", path);
|
||||
}
|
||||
|
||||
function realPath(path) {
|
||||
return core.opAsync("op_realpath_async", pathFromURL(path));
|
||||
return core.opAsync("op_realpath_async", path);
|
||||
}
|
||||
|
||||
function removeSync(
|
||||
|
|
Loading…
Reference in a new issue