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EAAWjC,EAAckC,GAEvC,Q,EAAOC,I,0BAAenC,EAAMkC,G,MCOvB,SAASE,EAAaC,EAAmBC,GAG9C,MAAMC,GAAW,EAAArC,EAAAsC,UAASF,EAAYD,GAEtC,SAAeE,GAAyB,OAAbA,GAAsBA,EAASE,WAAW,KAAKvC,EAAAS,MAAU4B,KAAa,EAAArC,EAAAwC,SAAQL,G,mgCC/B3G,MAAMlC,SACJwC,EAAQC,UACRC,EAAStB,QACTuB,EAAO1C,QACP2C,EAAOC,OACPC,EAAMC,WACNC,EAAU7B,KACV8B,EAAI9C,UACJ+C,EAASC,MACTC,EAAKC,MACLC,EAAKjB,SACLkB,EAAQhB,QACRiB,EAAOhD,IACPiD,EAAGC,iBACHC,EAAgBC,MAChBC,GACE9D,E","sources":["src/name.ts","src/normalize-trim.ts","node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js","src/add-exe-ext.ts","src/add-name-prefix.ts","src/add-name-suffix.ts","src/add-sh-ext.ts","src/add-sh-relative-prefix.ts","src/remove-ext.ts","src/replace-ext.ts","src/is-path-inside.ts","src/index-node.ts"],"sourcesContent":["import { basename, extname } from \"path\"\n\n/**\n * Get the name of the given file path.\n *\n * By default the file extension is included in the returned name. To remove the extension, set the second parameter to `false`.\n *\n * @example\n *\n * ```js\n * import { name } from \"patha\"\n *\n * name(\"path/to/file.md\") // gives \"file.md\"\n *\n * name(\"path/to/file.md\", false) // gives \"file\"\n * ```\n *\n * @param path The given file path\n * @param includeExtension If the name should include the file extension as well\n * @returns The base name without the extension\n */\nexport function name(path: string, includeExtension: boolean = true) {\n  if (includeExtension) {\n    return basename(path)\n  } else {\n    return basename(path, extname(path))\n  }\n}\n","import { normalize, sep } from \"path\"\nimport escapeRegexp from \"escape-string-regexp\"\n\n/**\n * Normalizes the path and removes the trailing slashes.\n *\n * @example\n *\n * ```js\n * import { normalize, normalizeTrim } from \"patha\"\n *\n * normalizeTrim(\"/foo/bar//baz/asdf/hello/../\") // gives \"/foo/bar/baz/asdf\"\n *\n * normalize(\"/foo/bar//baz/asdf/hello/../\") // gives \"/foo/bar/baz/asdf/\"\n * ```\n *\n * @param path The given file path\n * @returns The normalized and trimmed file path\n */\nexport function normalizeTrim(path: string) {\n  return normalize(path).replace(new RegExp(`${escapeRegexp(sep)}$`), \"\")\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * Add bin extension to the given binary name.\n *\n * @example\n *\n * ```js\n * import { addExeExt } from \"patha\"\n *\n * addExeExt(\"path/to/file-name\") // gives \"path/to/file-name.exe\" on Windows and \"path/to/file-name\" on others\n * ```\n *\n * @param name The name you want to add the shell extension to\n * @param win_ext Defaults to `.exe` on Windows\n * @param other_ext Defaults to `\"\"` On other platforms.\n */\nexport function addExeExt(name: string, win_ext = \".exe\", other_ext = \"\") {\n  if (process.platform === \"win32\") {\n    return `${name}${win_ext}`\n  }\n  return `${name}${other_ext}`\n}\n","import { basename, dirname, extname, join } from \"path\"\n\n/**\n * Adds a prefix to the start of the name of the given path\n *\n * @example\n *\n * ```js\n * import { addNamePrefix } from \"patha\"\n *\n * addNamePrefix(\"path/to/file-name.ext\", \"new-\") // gives \"path/to/new-file-name.ext\"\n * ```\n *\n * @param path The given file path\n * @param prefix The prefix to add to the start of the file name\n * @returns The path with a prefix added to its file name\n */\nexport function addNamePrefix(path: string, prefix: string) {\n  // get the extension and the file name\n  const ext = extname(path)\n  const nameWithoutExt = basename(path, ext)\n\n  // add the name prefix\n  const NameWithPrefix = `${prefix}${nameWithoutExt}${ext}`\n\n  // add the dirname back\n  return join(dirname(path), NameWithPrefix)\n}\n","import { basename, dirname, extname, join } from \"path\"\n\n/**\n * Adds a suffix to the end of the name of the given path\n *\n * @example\n *\n * ```js\n * import { addNameSuffix } from \"patha\"\n *\n * addNameSuffix(\"path/to/file-name.ext\", \"-old\") // gives \"path/to/file-name-old.ext\"\n *\n * addNameSuffix(\"path/to/file-name.ext\", \".test\") // gives \"path/to/file-name.test.ext\"\n * ```\n *\n * @param path The given file path\n * @param suffix The suffix to add to the end of the file name\n * @returns The path with a suffix added to its file name\n */\nexport function addNameSuffix(path: string, suffix: string) {\n  // get the extension and the file name\n  const ext = extname(path)\n  const nameWithoutExt = basename(path, ext)\n\n  // add the name suffix\n  const NameWithSuffix = `${nameWithoutExt}${suffix}${ext}`\n\n  // add the dirname back\n  return join(dirname(path), NameWithSuffix)\n}\n","/**\n * Add a native shell extension to the given name.\n *\n * @example\n *\n * ```js\n * import { addShExt } from \"patha\"\n *\n * addShExt(\"path/to/file-name\") // gives \"path/to/file-name.cmd\" on Windows and \"path/to/file-name.sh\" on others\n *\n * addShExt(\"path/to/file-name\", \".bat\") // gives \"path/to/file-name.bat\" on Windows and \"path/to/file-name.sh\" on others\n * ```\n *\n * @param name The name you want to add the shell extension to\n * @param win_ext `.cmd` on Windows\n * @param other_ext `.sh` On others.\n * @returns The file path with the shell extension added\n */\nexport function addShExt(name: string, win_ext = \".cmd\", other_ext = \".sh\") {\n  if (process.platform === \"win32\") {\n    return `${name}${win_ext}`\n  }\n  return `${name}${other_ext}`\n}\n","/**\n * Prefix a `./` for unix shell and nothing for `cmd`.\n *\n * @example\n *\n * ```js\n * import { addShRelativePrefix } from \"patha\"\n *\n * addShRelativePrefix(\"some/file-name\") // gives \"some/file-name\" on Windows and \"./some/file-name\" on others.\n * ```\n *\n * @param path The given path\n * @returns The path with `./` added on Unix\n */\nexport function addShRelativePrefix(path: string) {\n  if (process.platform === \"win32\") {\n    return path\n  }\n  return `./${path}`\n}\n","import { extname } from \"path\"\n\n/**\n * Remove a path's extension.\n *\n * @example\n *\n * ```js\n * import { removeExt } from \"patha\"\n *\n * removeExt(\"some/dir/file.ext\") // gives \"some/dir/file\"\n * ```\n *\n * @param path The given path\n * @returns The path without its file extension\n */\nexport function removeExt(path: string) {\n  const extensionLength = extname(path).length\n  return path.slice(0, -extensionLength)\n}\n","import replaceExtOrig from \"replace-ext\"\n\n/**\n * Replaces the extension from path with extension and returns the updated path string.\n *\n * Does not replace the extension if path is not a string or is empty.\n *\n * @example\n *\n * ```js\n * import { replaceExt } from \"patha\"\n *\n * replaceExt(\"path/to/file.md\", \".html\") // gives \"path/to/file.html\"\n * ```\n *\n * @param path The given path\n * @param extension The extension to replace\n */\nexport function replaceExt(path: string, extension: string) {\n  // TODO replaceExt should not change `/` to `\\\\` on Windows\n  return replaceExtOrig(path, extension)\n}\n","import { relative, resolve, sep } from \"path\"\n\n/**\n * Check if a path is inside another path.\n *\n * Note that relative paths are resolved against `process.cwd()` to make them absolute.\n *\n * This function does not check if the paths exist and it only works with strings.\n *\n * @example\n *\n * ```js\n * import { isPathInside } from \"patha\"\n *\n * isPathInside(\"a/b/c\", \"a/b\")\n * //=> true\n *\n * isPathInside(\"a/b/c\", \"x/y\")\n * //=> false\n *\n * isPathInside(\"a/b/c\", \"a/b/c\")\n * //=> false\n *\n * isPathInside(\"/Users/some/dev/aa\", \"/Users/some\")\n * //=> true\n * ```\n */\nexport function isPathInside(childPath: string, parentPath: string): boolean {\n  // copied from is-path-inside because the package uses node:path that can't be bundled for the browser\n\n  const relation = relative(parentPath, childPath)\n\n  return Boolean(relation && relation !== \"..\" && !relation.startsWith(`..${sep}`) && relation !== resolve(childPath))\n}\n","import * as path from \"path\"\nconst {\n  basename,\n  delimiter,\n  dirname,\n  extname,\n  format,\n  isAbsolute,\n  join,\n  normalize,\n  parse,\n  posix,\n  relative,\n  resolve,\n  sep,\n  toNamespacedPath,\n  win32,\n} = path\n\nexport {\n  basename,\n  delimiter,\n  dirname,\n  extname,\n  format,\n  isAbsolute,\n  join,\n  normalize,\n  parse,\n  posix,\n  relative,\n  resolve,\n  sep,\n  toNamespacedPath,\n  win32,\n}\n\nexport * from \"./lib\"\n"],"names":["$8e6c06d65ba08e55$export$a8ff84c12d48cfa6","path","includeExtension","$2nB99$path","basename","extname","$749f9e49b51506c8$export$873fead74fe2f1ff","normalize","replace","RegExp","string","TypeError","sep","$a0f54d74c929f598$export$2d20c564cade3c93","name","win_ext","other_ext","process","platform","$6eea8ba6d5795687$export$3e333f8cb13439c","prefix","ext","NameWithPrefix","join","dirname","$122c04cc041e5e94$export$3b60a3e9bd1aef9d","suffix","NameWithSuffix","$d8275abffe4ac043$export$609be29b80b555e1","$b1221c6a6acb0dfb$export$e1f23f8d3e53fe6","$96b7a0cf15bd9653$export$19c5468f88f6e968","extensionLength","length","slice","$a5a60d9e41e2f0db$export$e9c34737ac8e53d2","extension","$2nB99$replaceext","$17e50f2e6a73c3c2$export$7d0573375890d05c","childPath","parentPath","relation","relative","startsWith","resolve","$acaaebecdf92a2ce$export$9bf319d8f74f51d1","delimiter","$acaaebecdf92a2ce$export$c889f2fcc19dbf12","$acaaebecdf92a2ce$export$7f7b8152cc673abe","$acaaebecdf92a2ce$export$d0e86f3a75393fa3","format","$acaaebecdf92a2ce$export$d9468344d3651243","isAbsolute","$acaaebecdf92a2ce$export$e434c7255acda994","$acaaebecdf92a2ce$export$f7e2c8231c57a8bd","$acaaebecdf92a2ce$export$a3295358bff77e","parse","$acaaebecdf92a2ce$export$98e6a39c04603d36","posix","$acaaebecdf92a2ce$export$8585d06717c0ab37","$acaaebecdf92a2ce$export$f0e7d1106eeabbe6","$acaaebecdf92a2ce$export$f7ad0328861e2f03","$acaaebecdf92a2ce$export$5aee1a5bd9743d8f","toNamespacedPath","$acaaebecdf92a2ce$export$c8b5bbc3171ae22a","win32","$acaaebecdf92a2ce$export$e242fbdac2d35a87"],"version":3,"file":"index.node.cjs.map","sourceRoot":"../"}