Replaces a path's extension with a new one. If the original path has no extension, newExtension will be appended.
newExtension
import {replaceExtension} from '@augment-vir/common';replaceExtension({path: '/users/stuff/file.ts?tail', newExtension: '.js'});// '/users/stuff/file.js?tail' Copy
import {replaceExtension} from '@augment-vir/common';replaceExtension({path: '/users/stuff/file.ts?tail', newExtension: '.js'});// '/users/stuff/file.js?tail'
@augment-vir/common
Replaces a path's extension with a new one. If the original path has no extension,
newExtension
will be appended.