// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

/**
 * A parsed path object generated by path.parse() or consumed by path.format().
 *
 * @example
 * ```ts
 * import { parse } from "@std/path";
 *
 * const parsedPathObj = parse("c:\\path\\dir\\index.html");
 * parsedPathObj.root; // "c:\\"
 * parsedPathObj.dir; // "c:\\path\\dir"
 * parsedPathObj.base; // "index.html"
 * parsedPathObj.ext; // ".html"
 * parsedPathObj.name; // "index"
 * ```
 */
export interface ParsedPath {
  /**
   * The root of the path such as '/' or 'c:\'
   */
  root: string;
  /**
   * The full directory path of the parent such as '/home/user/dir' or 'c:\path\dir'
   */
  dir: string;
  /**
   * The file name including extension (if any) such as 'index.html'
   */
  base: string;
  /**
   * The file extension (if any) such as '.html'
   */
  ext: string;
  /**
   * The file name without extension (if any) such as 'index'
   */
  name: string;
}

export type FormatInputPathObject = Partial<ParsedPath>;

// denoCacheMetadata={"headers":{"access-control-allow-origin":"*","x-content-type-options":"nosniff","x-robots-tag":"noindex","server":"cloudflare","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","content-type":"text/typescript","date":"Mon, 25 May 2026 09:44:57 GMT","cache-control":"public, max-age=31536000, immutable","alt-svc":"h3=\":443\"; ma=86400","content-length":"1055","cross-origin-resource-policy":"cross-origin","cf-ray":"a0139abd0d1770c4-ORD","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","x-jsr-backend":"modules","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=ZzlUGera5%2BIhoo2t%2B5GMD%2FKAHY1iDkfIaNJS%2B7u5XN9%2BImn9F%2F6u18c%2BAOOEc%2Bv9%2BpYYZ6%2BrX5zCIycHwwBm%2BZJ59aZkJhZYKvipv1uplXqy8j75U8SoTk4%3D\"}]}","vary":"Origin","access-control-expose-headers":"*","etag":"\"d15991935c2cb42513547fbca0acb2f2\""},"url":"https://jsr.io/@std/path/0.224.0/_interface.ts","time":1779702297}