Function
pathsFromVariable
(environmentVariable: string = 'PATH')
Source from the content-addressed store, hash-verified
| 17 | export const normalize = isWindows ? (p: string) => norm(p).toLowerCase().replace(/^([a-z]\:)/, ($1) => $1.toUpperCase()) : norm; |
| 18 | |
| 19 | export function pathsFromVariable(environmentVariable: string = 'PATH'): string[] { |
| 20 | return process.env[environmentVariable]?.split(delimiter) || []; |
| 21 | } |
| 22 | |
| 23 | export async function filterToFolders(paths: string[]): Promise<string[]> { |
| 24 | const set = new Set(paths); |
Tested by
no test coverage detected