Skip to main content
Home
This release is 13 versions behind 1.1.4 — the latest version of @std/path. Jump to latest

@std/path@1.0.1
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Deno, Browsers
This package works with Cloudflare Workers
This package works with Deno
This package works with Browsers
JSR Score94%
Downloads140,824/wk
Published2 years ago (1.0.1)

Utilities for working with file system paths

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. import { common as _common } from "../_common/common.ts"; import { SEPARATOR } from "./constants.ts"; /** Determines the common path from a set of paths for POSIX systems. * * @example Usage * ```ts * import { common } from "@std/path/posix/common"; * import { assertEquals } from "@std/assert"; * * const path = common([ * "./deno/std/path/mod.ts", * "./deno/std/fs/mod.ts", * ]); * assertEquals(path, "./deno/std/"); * ``` * * @param paths The paths to compare. * @returns The common path. */ export function common(paths: string[]): string { return _common(paths, SEPARATOR); }