Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
9
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.4.1 to 0.5.0

.idea/checkstyle-idea.xml

26

lib/index.js

@@ -69,3 +69,3 @@ 'use strict';

extractStaticValueFromCode(_fs2.default.readFileSync(file, ENCODING), _extends({}, opts, {
extractStaticValueFromCode(_fs2.default.readFileSync(file), _extends({}, opts, {
filename: file

@@ -75,2 +75,4 @@ }), cb);

var cachedFiles = {};
var extractStaticValueImportedFilesFromFile = exports.extractStaticValueImportedFilesFromFile = function extractStaticValueImportedFilesFromFile(file) {

@@ -80,3 +82,2 @@ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var cachedFiles = {};
var staticPropsList = [];

@@ -87,4 +88,11 @@

if (opts.include && !opts.include.find(function (includePath) {
return file.search(includePath) !== -1;
})) {
return;
}
extractStaticValueFromFile(file, opts, function (_staticPropsList, _importsDeclarations) {
staticPropsList = staticPropsList.concat(_staticPropsList);
cachedFiles[file] = _staticPropsList;
importsDeclarations = _importsDeclarations;

@@ -96,3 +104,4 @@ });

_extractStaticValueImportedFilesFromFile(file, opts, staticPropsList);
cachedFiles[file] = true;
} else {
staticPropsList = staticPropsList.concat(cachedFiles[file]);
}

@@ -102,4 +111,11 @@ });

_extractStaticValueImportedFilesFromFile(file, opts);
if (cachedFiles[file]) {
staticPropsList = cachedFiles[file];
} else {
_extractStaticValueImportedFilesFromFile(file, opts);
cachedFiles[file] = staticPropsList;
}
var values = [].concat(_toConsumableArray(new Set(staticPropsList)));
cb(values);

@@ -132,2 +148,4 @@

cachedFiles = {};
if (content !== previousContent) {

@@ -134,0 +152,0 @@ _fs2.default.mkdirSync(saveFilePath, { recursive: true });

2

package.json
{
"name": "@hh.ru/babel-plugin-static-value-extractor",
"version": "0.4.1",
"version": "0.5.0",
"main": "lib/index.js",

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

@@ -17,3 +17,4 @@ # babel-plugin-static-value-extractor

saveFileExt: — расширение файла,
pathsToReplace: — webpackAliases
pathsToReplace: — webpackAliases,
include: — массив строк путей файлов для которых нужно извлекать значения статических свойств,
template: — функция которая возвращает шаблон контента(string), в качестве аргумента передается объект с ключами названий Файлов и значением массивов извлеченных значений, если не передать контентом сохраненного файла будет JSON представление.',

@@ -20,0 +21,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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