6 lines
197 B
TypeScript
6 lines
197 B
TypeScript
export function maybeJs(options: { js?: boolean }, path: string): string {
|
|
return options.js && (path.endsWith('.ts') || path.endsWith('.tsx'))
|
|
? path.replace(/\.tsx?$/, '.js')
|
|
: path;
|
|
}
|