Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(std/path) duplicate export sep/SEP and naming conventions #3332

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions path/_separator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

// NOTE: This file exists to break circular referencecs; it should NOT be
// imported directly, outside of the "std/path" module.

import { isWindows } from "../_util/os.ts";
import { sep as win32Sep } from "./win32.ts";
import { sep as posixSep } from "./posix.ts";

export const SEP = isWindows ? win32Sep : posixSep;
export const SEP_PATTERN = isWindows ? /[\\/]+/ : /\/+/;
2 changes: 1 addition & 1 deletion path/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

import { SEP } from "./separator.ts";
import { SEP } from "./_separator.ts";

/** Determines the common path from a set of paths, using an optional separator,
* which defaults to the OS default separator.
Expand Down
2 changes: 1 addition & 1 deletion path/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This module is browser compatible.

import { isWindows, osType } from "../_util/os.ts";
import { SEP, SEP_PATTERN } from "./separator.ts";
import { SEP, SEP_PATTERN } from "./_separator.ts";
import * as _win32 from "./win32.ts";
import * as _posix from "./posix.ts";
import type { OSType } from "../_util/os.ts";
Expand Down
2 changes: 1 addition & 1 deletion path/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export const {
} = path;

export * from "./common.ts";
export { SEP, SEP_PATTERN } from "./separator.ts";
export * from "./_separator.ts";
export * from "./_interface.ts";
export * from "./glob.ts";
7 changes: 0 additions & 7 deletions path/separator.ts

This file was deleted.