Files
NetMesh/electron/shared/pathLikeCommand.cjs

19 lines
477 B
JavaScript
Raw Permalink Normal View History

"use strict";
function isPathLikeCommand(command) {
const normalized = String(command || "").trim();
return normalized.includes("/") || normalized.includes("\\") || /^[a-z]:/i.test(normalized);
}
function getCommandBasename(command) {
const normalized = String(command || "").trim();
if (!normalized) return "";
const parts = normalized.split(/[\\/]/);
return (parts.pop() || "").toLowerCase();
}
module.exports = {
isPathLikeCommand,
getCommandBasename,
};