make-pesto
Version:
Pesto is a command-line tool to assist in creating Node.js packages. 🔪🌿
16 lines (14 loc) • 438 B
text/typescript
import path from "path";
/**
* Generates an absolute path from the given path.
* @param {string} pathToCheck - The path to be resolved.
* @returns {string} The resolved absolute path.
* @throws {Error} Throws an error if any preparation step fails.
*/
export function generatePath(pathToCheck: string): string {
try {
return path.resolve(pathToCheck);
} catch (err) {
throw new Error(err as string);
}
}