Socket
Socket
Sign inDemoInstall

mendel-development

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mendel-development - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

33

mendelify-require-transform.js

@@ -7,25 +7,24 @@ /* Copyright 2015, Yahoo Inc.

var isRequire = require('./falafel-util').isRequire;
var variationMatches = require('./variation-matches');
var regexExt = /(\.js|\.coffee|\.coffee.md|\.litcoffee|\.jsx|\.es|\.es6)$/;
function mendelifyRequireTransform(filename, src, variations) {
var opts = {
ecmaVersion: 6,
allowReturnOutsideFunction: true
};
if (!regexExt.test(filename)) {
return src;
}
return falafel(src, opts, function (node) {
if (isRequire(node)) {
var value = node.arguments[0].value;
var match = variationMatches(variations, value);
if (match) {
if(match) node.update('require(\'' + match.file + '\')');
}
function mendelifyRequireTransform(filename, src, transformerFn) {
var opts = {
ecmaVersion: 6,
allowReturnOutsideFunction: true
};
if (!regexExt.test(filename)) {
return src;
}
}).toString();
return falafel(src, opts, function(node) {
if (isRequire(node)) {
var value = node.arguments[0].value;
var newValue = transformerFn(value);
if (newValue !== value) {
node.update('require(\'' + newValue + '\')');
}
}
}).toString();
}
module.exports = mendelifyRequireTransform;

@@ -45,3 +45,3 @@ /* Copyright 2015, Yahoo Inc.

if (!avoidMendelify(value) || shouldExternalize(externals, key)) {
newKey = pathOrVariationMatch(key, variations);
newKey = keyValue(key, variations, bundle);
}

@@ -55,3 +55,9 @@

if (!avoidMendelifyRow) {
row.source = mendelifyRequireTransform(row.file, row.source, variations);
row.source = mendelifyRequireTransform(
row.file,
row.source,
function(requirePath) {
return keyValue(requirePath, variations, bundle);
}
);
}

@@ -65,2 +71,6 @@ row.sha = shasum(row.source);

function keyValue(key, variations, bundle) {
return relativePath(pathOrVariationMatch(key, variations), bundle);
}
function avoidMendelify(file) {

@@ -67,0 +77,0 @@ var isExternal = file === false;

{
"name": "mendel-development",
"version": "1.1.1",
"version": "1.1.2",
"description": "Mendel shared dependencies for build and development",

@@ -5,0 +5,0 @@ "main": "index.js",

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