All files / path / constants.ts

100.00% Branches 6/6
100.00% Functions 0/0
100.00% Lines 4/4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
 
x42
 
 
 
 
 
x42
 
 
 
 
x42
 
 
 
x42
















// Copyright 2018-2026 the Deno authors. MIT license.
// This module is browser compatible.
import { isWindows } from "@std/internal/os";

/**
 * The character used to separate entries in the PATH environment variable.
 * On Windows, this is `;`. On all other platforms, this is `:`.
 */
export const DELIMITER = isWindows ? ";" as const : ":" as const;
/**
 * The character used to separate components of a file path.
 * On Windows, this is `\`. On all other platforms, this is `/`.
 */
export const SEPARATOR = isWindows ? "\\" as const : "/" as const;
/**
 * A regular expression that matches one or more path separators.
 */
export const SEPARATOR_PATTERN = isWindows ? /[\\/]+/ : /\/+/;