@storm-software/config-tools
Version:
⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.
26 lines (23 loc) • 780 B
JavaScript
import {
__name
} from "./chunk-SHUYVCID.js";
// src/utilities/file-path-utils.ts
import { sep } from "node:path";
var removeExtension = /* @__PURE__ */ __name((filePath) => {
const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
if (result.startsWith("./")) {
return result.substring(2);
}
if (result.startsWith(".") || result.startsWith("/")) {
return result.substring(1);
}
return result;
}, "removeExtension");
function findFileName(filePath) {
return filePath?.split(filePath?.includes(sep) ? sep : filePath?.includes("/") ? "/" : "\\")?.pop() ?? "";
}
__name(findFileName, "findFileName");
export {
removeExtension,
findFileName
};