UNPKG

npmize

Version:

Let's create an npm package without worrying about anything.

10 lines (9 loc) 320 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNewFilePath = getNewFilePath; function getNewFilePath(filePath, type) { const prefix = type[0]; return filePath.replace(/\.(js|ts)$/, (match) => { return match.replace(/(js|ts)/i, (type) => prefix + type); }); }