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

import { isWindows } from "./_os.ts";
import { resolve as posixResolve } from "./posix/resolve.ts";
import { resolve as windowsResolve } from "./windows/resolve.ts";

/**
 * Resolves path segments into a `path`
 * @param pathSegments to process to path
 */
export function resolve(...pathSegments: string[]): string {
  return isWindows
    ? windowsResolve(...pathSegments)
    : posixResolve(...pathSegments);
}

// denoCacheMetadata={"headers":{"date":"Tue, 28 Jul 2026 12:31:15 GMT","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=dVGy29XgoTRVjIixbJX2qooNQhVEY0Rt1e8hOEpWr1kKUsGikg6yUs7t4%2F4j0uBLNfnaVxrMfseivQ0GVmrI9co3MyoaKjyTX%2B6fT2XlDqdwts0GCjD516U%3D\"}]}","cf-cache-status":"HIT","access-control-expose-headers":"*","x-robots-tag":"noindex","access-control-allow-origin":"*","vary":"Origin","cross-origin-resource-policy":"cross-origin","cf-ray":"a223e6579a237db6-LAX","cache-control":"public, max-age=31536000, immutable","accept-ranges":"bytes","age":"44352","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';","etag":"\"11ae35f186a53f39f129b53fc0d3dede\"","content-length":"528","server":"cloudflare","x-jsr-backend":"modules","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=86400","set-cookie":"__cf_bm=HRiRLmwg0OPRFabO_TOSs0oaJ37vg3DHbRFrCAg74Wg-1785241875.1418629-1.0.1.1-CxsVC7dnvfUjhrrST04b.dmsojfhNwbaga1wlX4WSkvXnLc4fG3njtD.qgaqVdRkAZs2m7BgIJyY_ydFttjEizIiI_7MG5Vdp7qCJjnkUZTk3Q8A_gul7.lW5KjB2NJF; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","content-type":"text/typescript","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}"},"url":"https://jsr.io/@std/path/0.224.0/resolve.ts","time":1785241875}