Convert an absolute path to a tilde path by replacing the user's home directory with ~
93
Evaluation — 93%
↑ 1.09xAgent success when using this tile
A utility for displaying file paths in a user-friendly format in terminal applications.
@generates
/**
* Converts an absolute file path to a user-friendly display format.
* Paths within the user's home directory are converted to tilde notation.
*
* @param {string} absolutePath - An absolute file system path
* @returns {string} The formatted path suitable for display
*/
function formatPathForDisplay(absolutePath) {
// IMPLEMENTATION HERE
}
module.exports = { formatPathForDisplay };Provides path formatting support.
The following test cases should be implemented in test/path-display.test.js:
/Users/username/documents/project)formatPathForDisplay is called with this path~/documents/project)/Users/username)formatPathForDisplay is called with this path~/var/log/system.log)formatPathForDisplay is called with this path/var/log/system.logInstall with Tessl CLI
npx tessl i tessl/npm-tildify