(inputPath: string)
| 127 | // oclif's default path resolver only applies when parsed as `--flag path` |
| 128 | // else it would not resolve, hence we need to resolve it manually. |
| 129 | export function resolveToAbsolutePath(inputPath: string): string { |
| 130 | const regex = new RegExp(`^~(?=$|[/\\\\])`); |
| 131 | return path.resolve(inputPath.replace(regex, os.homedir())); |
| 132 | } |
| 133 | |
| 134 | export function isValidEnum<T extends Record<string, string>>(enumType: T, input: string): input is T[keyof T] { |
| 135 | return Object.values(enumType).includes(input); |
no outgoing calls
no test coverage detected