Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const normalizeExtensions = (uri: URI | string): Maybe => {
const ext = URI.isUri(uri) ? extname(uri.fsPath) : extname(uri);
const uriString = uri.toString();
switch (ext) {
case '.ks':
return uriString;
case '.ksm':
return uriString.replace('.ksm', '.ks');
case '':
return `${uriString}.ks`;
default:
return undefined;
}
};