liferay-npm-build-tools-common
Advanced tools
Comparing version 1.2.3 to 1.3.0
@@ -8,2 +8,3 @@ 'use strict'; | ||
exports.getPackageDir = getPackageDir; | ||
exports.getPackageTargetDir = getPackageTargetDir; | ||
@@ -66,2 +67,21 @@ var _fs = require('fs'); | ||
} | ||
/** | ||
* Converts a package name (optionally versioned) to its target folder name | ||
* inside bundled node_modules. | ||
* @param {String} name a package name | ||
* @param {String} [version=null] an optional package version | ||
* @return {String} the target folder | ||
*/ | ||
function getPackageTargetDir(name) { | ||
var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var targetFolder = name.replace('/', '%2F'); | ||
if (version) { | ||
targetFolder += '@' + version; | ||
} | ||
return targetFolder; | ||
} | ||
//# sourceMappingURL=packages.js.map |
{ | ||
"name": "liferay-npm-build-tools-common", | ||
"version": "1.2.3", | ||
"version": "1.3.0", | ||
"description": "Utility library for Liferay NPM Build Tools.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -52,1 +52,18 @@ import fs from 'fs'; | ||
} | ||
/** | ||
* Converts a package name (optionally versioned) to its target folder name | ||
* inside bundled node_modules. | ||
* @param {String} name a package name | ||
* @param {String} [version=null] an optional package version | ||
* @return {String} the target folder | ||
*/ | ||
export function getPackageTargetDir(name, version = null) { | ||
let targetFolder = name.replace('/', '%2F'); | ||
if (version) { | ||
targetFolder += `@${version}`; | ||
} | ||
return targetFolder; | ||
} |
Sorry, the diff of this file is not supported yet
7456
121