mirror of
https://github.com/denoland/deno.git
synced 2024-11-26 16:09:27 -05:00
fix(std/fs): mark createWalkEntry(Sync) as internal (#7643)
This commit is contained in:
parent
1021dad5f6
commit
3ac9f1e209
2 changed files with 10 additions and 10 deletions
|
@ -10,8 +10,8 @@ import {
|
||||||
} from "../path/mod.ts";
|
} from "../path/mod.ts";
|
||||||
import {
|
import {
|
||||||
WalkEntry,
|
WalkEntry,
|
||||||
createWalkEntry,
|
_createWalkEntry,
|
||||||
createWalkEntrySync,
|
_createWalkEntrySync,
|
||||||
walk,
|
walk,
|
||||||
walkSync,
|
walkSync,
|
||||||
} from "./walk.ts";
|
} from "./walk.ts";
|
||||||
|
@ -104,7 +104,7 @@ export async function* expandGlob(
|
||||||
|
|
||||||
let fixedRootInfo: WalkEntry;
|
let fixedRootInfo: WalkEntry;
|
||||||
try {
|
try {
|
||||||
fixedRootInfo = await createWalkEntry(fixedRoot);
|
fixedRootInfo = await _createWalkEntry(fixedRoot);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return throwUnlessNotFound(error);
|
return throwUnlessNotFound(error);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ export async function* expandGlob(
|
||||||
const parentPath = joinGlobs([walkInfo.path, ".."], globOptions);
|
const parentPath = joinGlobs([walkInfo.path, ".."], globOptions);
|
||||||
try {
|
try {
|
||||||
if (shouldInclude(parentPath)) {
|
if (shouldInclude(parentPath)) {
|
||||||
return yield await createWalkEntry(parentPath);
|
return yield await _createWalkEntry(parentPath);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throwUnlessNotFound(error);
|
throwUnlessNotFound(error);
|
||||||
|
@ -211,7 +211,7 @@ export function* expandGlobSync(
|
||||||
|
|
||||||
let fixedRootInfo: WalkEntry;
|
let fixedRootInfo: WalkEntry;
|
||||||
try {
|
try {
|
||||||
fixedRootInfo = createWalkEntrySync(fixedRoot);
|
fixedRootInfo = _createWalkEntrySync(fixedRoot);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return throwUnlessNotFound(error);
|
return throwUnlessNotFound(error);
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ export function* expandGlobSync(
|
||||||
const parentPath = joinGlobs([walkInfo.path, ".."], globOptions);
|
const parentPath = joinGlobs([walkInfo.path, ".."], globOptions);
|
||||||
try {
|
try {
|
||||||
if (shouldInclude(parentPath)) {
|
if (shouldInclude(parentPath)) {
|
||||||
return yield createWalkEntrySync(parentPath);
|
return yield _createWalkEntrySync(parentPath);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throwUnlessNotFound(error);
|
throwUnlessNotFound(error);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import { assert } from "../_util/assert.ts";
|
import { assert } from "../_util/assert.ts";
|
||||||
import { basename, join, normalize } from "../path/mod.ts";
|
import { basename, join, normalize } from "../path/mod.ts";
|
||||||
|
|
||||||
export function createWalkEntrySync(path: string): WalkEntry {
|
export function _createWalkEntrySync(path: string): WalkEntry {
|
||||||
path = normalize(path);
|
path = normalize(path);
|
||||||
const name = basename(path);
|
const name = basename(path);
|
||||||
const info = Deno.statSync(path);
|
const info = Deno.statSync(path);
|
||||||
|
@ -17,7 +17,7 @@ export function createWalkEntrySync(path: string): WalkEntry {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createWalkEntry(path: string): Promise<WalkEntry> {
|
export async function _createWalkEntry(path: string): Promise<WalkEntry> {
|
||||||
path = normalize(path);
|
path = normalize(path);
|
||||||
const name = basename(path);
|
const name = basename(path);
|
||||||
const info = await Deno.stat(path);
|
const info = await Deno.stat(path);
|
||||||
|
@ -98,7 +98,7 @@ export async function* walk(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (includeDirs && include(root, exts, match, skip)) {
|
if (includeDirs && include(root, exts, match, skip)) {
|
||||||
yield await createWalkEntry(root);
|
yield await _createWalkEntry(root);
|
||||||
}
|
}
|
||||||
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
|
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
|
||||||
return;
|
return;
|
||||||
|
@ -151,7 +151,7 @@ export function* walkSync(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (includeDirs && include(root, exts, match, skip)) {
|
if (includeDirs && include(root, exts, match, skip)) {
|
||||||
yield createWalkEntrySync(root);
|
yield _createWalkEntrySync(root);
|
||||||
}
|
}
|
||||||
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
|
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue