Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-name-amd-modules

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-name-amd-modules - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

15

lib/index.js

@@ -96,6 +96,5 @@ 'use strict';

* @param {object} opts the Babel plugin options
* @return {Array} the normalized srcPrefixes array
* @return {Array} the normalized srcPrefixes array (with native path
* separators)
*/
// TODO: check that module names work correctly in Windows
function getSrcPrefixes(opts) {

@@ -105,2 +104,4 @@ var srcPrefixes = opts.srcPrefixes || ['src/main/resources/META-INF/resources'];

return srcPrefixes.map(function (srcPrefix) {
return _path2.default.normalize(srcPrefix);
}).map(function (srcPrefix) {
return srcPrefix.endsWith(_path2.default.sep) ? srcPrefix : srcPrefix + _path2.default.sep;

@@ -116,3 +117,3 @@ });

* compiler
* @return {String} the package name ending with '/'
* @return {String} the package name (in 'pkg@version' format) ending with '/'
*/

@@ -165,3 +166,3 @@

for (var i = 0; i < srcPrefixes.length; i++) {
var srcPrefix = srcPrefixes[i];
var srcPrefix = _path2.default.normalize(srcPrefixes[i]);

@@ -174,4 +175,8 @@ if (moduleName.startsWith(srcPrefix)) {

if (_path2.default.sep == '\\') {
moduleName = moduleName.replace(/\\/g, '/');
}
return moduleName;
}
//# sourceMappingURL=index.js.map
{
"name": "babel-plugin-name-amd-modules",
"version": "1.2.0",
"version": "1.2.1",
"description": "A Babel plugin to give name to AMD modules based on their path and package.",

@@ -15,5 +15,5 @@ "main": "lib/index.js",

"dependencies": {
"liferay-npm-build-tools-common": "^1.2.0",
"liferay-npm-build-tools-common": "^1.2.1",
"read-json-sync": "^1.1.1"
}
}

@@ -1,3 +0,1 @@

// TODO: check that module names work correctly in Windows
import * as pkgs from 'liferay-npm-build-tools-common/lib/packages';

@@ -95,3 +93,4 @@ import path from 'path';

* @param {object} opts the Babel plugin options
* @return {Array} the normalized srcPrefixes array
* @return {Array} the normalized srcPrefixes array (with native path
* separators)
*/

@@ -103,6 +102,8 @@ function getSrcPrefixes(opts) {

return srcPrefixes.map(
srcPrefix =>
srcPrefix.endsWith(path.sep) ? srcPrefix : srcPrefix + path.sep,
);
return srcPrefixes
.map(srcPrefix => path.normalize(srcPrefix))
.map(
srcPrefix =>
srcPrefix.endsWith(path.sep) ? srcPrefix : srcPrefix + path.sep,
);
}

@@ -116,3 +117,3 @@

* compiler
* @return {String} the package name ending with '/'
* @return {String} the package name (in 'pkg@version' format) ending with '/'
*/

@@ -157,3 +158,3 @@ function getPackageName(packageName, filenameRelative) {

for (let i = 0; i < srcPrefixes.length; i++) {
const srcPrefix = srcPrefixes[i];
const srcPrefix = path.normalize(srcPrefixes[i]);

@@ -166,3 +167,7 @@ if (moduleName.startsWith(srcPrefix)) {

if (path.sep == '\\') {
moduleName = moduleName.replace(/\\/g, '/');
}
return moduleName;
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc