Socket
Socket
Sign inDemoInstall

mendel-development

Package Overview
Dependencies
Maintainers
1
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.0.5 to 1.0.6

51

mendelify-transform-stream.js

@@ -10,19 +10,24 @@ /* Copyright 2015, Yahoo Inc.

function mendelifyTransformStream(variations) {
function mendelifyTransformStream(variations, expose) {
return through.obj(function mendelify(row, enc, next) {
var match = variationMatches(variations, row.file);
if (match) {
row.id = match.file;
row.variation = match.dir;
if (!avoidMendelify(row.file)) {
var match = variationMatches(variations, row.file);
if (match) {
row.id = match.file;
row.variation = match.dir;
}
}
Object.keys(row.deps).forEach(function (key) {
var depMatch = variationMatches(variations, key);
if (depMatch) {
row.deps[depMatch.file] = depMatch.file;
delete row.deps[key];
if (!avoidMendelify(row.deps[key])) {
var depMatch = variationMatches(variations, key);
if (depMatch) {
row.deps[depMatch.file] = depsValue(
row.deps[key], variations, expose
);
delete row.deps[key];
}
}
});
row.rawSource = row.source;

@@ -37,2 +42,28 @@ row.source = mendelifyRequireTransform(row.file, row.source, variations);

function avoidMendelify(file) {
var isExternal = file === false;
var isNodeModule = -1 !== (file||'').indexOf("node_modules");
return isExternal || isNodeModule;
}
function depsValue(path, variations, expose) {
var exposedModule = exposeKey(expose, path);
if (exposedModule) {
return exposedModule;
}
return variationMatches(variations, path).file;
}
function exposeKey(expose, file) {
var exposedModule = false;
Object.keys(expose).forEach(function(key) {
var value = expose[key];
if (file === value) {
exposedModule = key;
}
});
return exposedModule;
}
module.exports = mendelifyTransformStream;

2

package.json
{
"name": "mendel-development",
"version": "1.0.5",
"version": "1.0.6",
"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