UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

13 lines (9 loc) 337 B
const { sep, normalize } = require("path"); function cleanPath(dirPath) { let normalized = normalize(dirPath); // to account for / path if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1); return normalized; } module.exports = { cleanPath };