MCPcopy Index your code
hub / github.com/faressoft/terminalizer / resolveFilePath

Function resolveFilePath

utility.js:172–183  ·  view source on GitHub ↗

* Resolve to an absolute path * * Accepts * - FileName * - FileName.ext * - /path/to/FileName * - /path/to/FileName.ext * * - Add the extension if not already added * - Resolve to `/path/to/FileName.ext` * * @param {String} filePath an absolute or a relative path * @param {St

(filePath, extension)

Source from the content-addressed store, hash-verified

170 * @return {String}
171 */
172function resolveFilePath(filePath, extension) {
173
174 var resolvedPath = di.path.resolve(filePath);
175
176 // The extension is not added
177 if (di.path.extname(resolvedPath) != '.' + extension) {
178 resolvedPath += '.' + extension;
179 }
180
181 return resolvedPath;
182
183}
184
185/**
186 * Get the default configurations

Callers 1

loadFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected