Socket
Socket
Sign inDemoInstall

@hh.ru/babel-plugin-static-value-extractor

Package Overview
Dependencies
Maintainers
11
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hh.ru/babel-plugin-static-value-extractor - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

test/fixtures/parse-dynamic-imports/actual.js

28

lib/traverser.js

@@ -40,2 +40,13 @@ 'use strict';

var processImports = function processImports(filePath) {
var defaultFileName = _path2.default.parse(filePath).ext ? '' : 'index.jsx';
var importPath = _path2.default.resolve(currentFileDir, filePath);
if (_fs2.default.existsSync(importPath)) {
importDeclarationPaths.push(_path2.default.resolve(importPath, defaultFileName));
} else if (_fs2.default.existsSync(importPath + '.jsx')) {
importDeclarationPaths.push(importPath + '.jsx');
}
};
return {

@@ -94,10 +105,13 @@ Program: {

if (node && node.source && !_path2.default.isAbsolute(node.source.value) && node.source.value[0] === '.') {
var defaultFileName = _path2.default.parse(node.source.value).ext ? '' : 'index.jsx';
var importPath = _path2.default.resolve(currentFileDir, node.source.value);
processImports(node.source.value);
}
}
},
if (_fs2.default.existsSync(importPath)) {
importDeclarationPaths.push(_path2.default.resolve(importPath, defaultFileName));
} else if (_fs2.default.existsSync(importPath + '.jsx')) {
importDeclarationPaths.push(importPath + '.jsx');
}
CallExpression: {
enter: function enter(_ref4) {
var node = _ref4.node;
if (node && node.callee && _babelCore.types.isImport(node.callee)) {
processImports(node.arguments[0].value);
}

@@ -104,0 +118,0 @@ }

{
"name": "@hh.ru/babel-plugin-static-value-extractor",
"version": "0.0.4",
"version": "0.0.5",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "devDependencies": {

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