{"version":3,"file":"resolver-Nkg5OKUN.mjs","names":["#url","#root"],"sources":["../src/utils/resolver.ts"],"sourcesContent":["\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\n// functions ==================================================================\n\n/**\n * A resolver for file paths relative to a base URL.\n */\nexport class PathResolver {\n\n  readonly #url: string\n  readonly #root: string\n\n  constructor(url: string) {\n    this.#url = url\n    this.#root = dirname(fileURLToPath(url))\n  }\n\n  /**\n   * @returns\n   *  The directory path of the URL passed to the constructor.\n   */\n  get root(): string {\n    return this.#root\n  }\n\n  /**\n   * Converts a file path relative to 'root' to an absolute file path.\n   *\n   * @param file\n   *  The file path to be converted.\n   *\n   * @returns\n   *  The absolute file path.\n   */\n  path(file: string): string {\n    return fileURLToPath(new URL(file, this.#url))\n  }\n}\n"],"mappings":";;;;;;AASA,IAAa,eAAb,MAA0B;CAExB;CACA;CAEA,YAAY,KAAa;EACvB,KAAKA,OAAO;EACZ,KAAKC,QAAQ,QAAQ,cAAc,GAAG,CAAC;CACzC;;;;;CAMA,IAAI,OAAe;EACjB,OAAO,KAAKA;CACd;;;;;;;;;;CAWA,KAAK,MAAsB;EACzB,OAAO,cAAc,IAAI,IAAI,MAAM,KAAKD,IAAI,CAAC;CAC/C;AACF"}