2024-01-18 05:54:39 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
// This module is browser compatible.
|
|
|
|
import { isWindows } from "./_os.ts";
|
|
|
|
|
2024-06-02 02:46:36 +00:00
|
|
|
/**
|
|
|
|
* The character used to separate entries in the PATH environment variable.
|
|
|
|
* On Windows, this is `;`. On all other platforms, this is `:`.
|
|
|
|
*/
|
2024-01-18 05:54:39 +00:00
|
|
|
export const DELIMITER = isWindows ? ";" as const : ":" as const;
|
2024-06-02 02:46:36 +00:00
|
|
|
/**
|
|
|
|
* The character used to separate components of a file path.
|
|
|
|
* On Windows, this is `\`. On all other platforms, this is `/`.
|
|
|
|
*/
|
2024-01-18 05:54:39 +00:00
|
|
|
export const SEPARATOR = isWindows ? "\\" as const : "/" as const;
|
2024-06-02 02:46:36 +00:00
|
|
|
/**
|
|
|
|
* A regular expression that matches one or more path separators.
|
|
|
|
*/
|
2024-01-18 05:54:39 +00:00
|
|
|
export const SEPARATOR_PATTERN = isWindows ? /[\\/]+/ : /\/+/;
|