-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
73 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
/** | ||
* @summary Identifies language by file extension. Uses 'fortran' by default. | ||
* @param filename {String} | ||
* @param defaultLanguage {String} | ||
*/ | ||
export function getProgrammingLanguageFromFileExtension( | ||
export declare function getProgrammingLanguageFromFileExtension( | ||
filename: string, | ||
defaultLanguage?: string, | ||
): any; | ||
): string; | ||
/** | ||
* @summary Formats a given file size. | ||
* @param size {Number} file size. | ||
* @param decimals {Number} number of decimals to round. | ||
* @param size file size. | ||
* @param decimals number of decimals to round. | ||
*/ | ||
export function formatFileSize(size: number, decimals?: number): string; | ||
export declare function formatFileSize(size: number, decimals?: number): string; | ||
/** Get list of paths for files in a directory and filter by file extensions if provided. | ||
* @param {string} dirPath - Path to current directory, i.e. $PWD | ||
* @param {string[]} fileExtensions - File extensions to filter, e.g. `.yml` | ||
* @param {boolean} resolvePath - whether to resolve the paths of files | ||
* @returns {string[]} - Array of file paths | ||
* @param dirPath - Path to current directory, i.e. $PWD | ||
* @param fileExtensions - File extensions to filter, e.g. `.yml` | ||
* @param resolvePath - whether to resolve the paths of files | ||
* @returns - Array of file paths | ||
*/ | ||
export function getFilesInDirectory( | ||
export declare function getFilesInDirectory( | ||
dirPath: string, | ||
fileExtensions?: string[], | ||
resolvePath?: boolean, | ||
): string[]; | ||
/** | ||
* Get list of directories contained in current directory. | ||
* @param {string} currentPath - current directory | ||
* @return {*} | ||
* @param currentPath - current directory | ||
*/ | ||
export function getDirectories(currentPath: string): any; | ||
export declare function getDirectories(currentPath: string): string[]; | ||
/** | ||
* Construct object path compatible with lodash.get/lodash.set from file path. | ||
* Note: if no root path is provided the file's dirname is taken instead. | ||
* @param {string} filePath - Path to file. | ||
* @param {string} root - Path to a parent directory to construct relative path. | ||
* @return {string} - Object path reflecting file path. | ||
* @param filePath - Path to file. | ||
* @param root - Path to a parent directory to construct relative path. | ||
* @return - Object path reflecting file path. | ||
* @example | ||
* createObjectPathFromFilePath("/a/b/c/d/e.yml", "/a/b"); | ||
* // "['c']['d']['e']" | ||
*/ | ||
export function createObjectPathFromFilePath(filePath: string, root: string): string; | ||
export declare function createObjectPathFromFilePath(filePath: string, root: string): string; | ||
export declare function createDirIfNotExists(directory: string): Promise<void>; | ||
export declare function cleanDirectory(directory: string): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters