Socket
Socket
Sign inDemoInstall

bigcode-astgen

Package Overview
Dependencies
87
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

18

index.js

@@ -5,2 +5,3 @@ const fs = require('fs');

const parser = require('acorn/dist/acorn_loose');
const _ = require('lodash');

@@ -191,6 +192,12 @@

function generateAndOuputAST(filepath, streams, callback) {
function generateAndOuputAST(filepath, streams, options, callback) {
bigcodeASTGen.fromFile(filepath, function(err, ast) {
if (!err && ast.length < options.minNodes) {
err = 'too few nodes';
}
if (!err && ast.length > options.maxNodes) {
err = 'too many nodes';
}
if (err) {
streams.failedFiles.write(filepath + '\n');
streams.failedFiles.write(filepath + '\t' + err + '\n');
return callback(null);

@@ -218,3 +225,3 @@ }

function processFiles(files, streams, callback) {
function processFiles(files, streams, options, callback) {
console.log(`starting to process ${files.length} files`);

@@ -226,3 +233,3 @@

}
generateAndOuputAST(file, streams, cb);
generateAndOuputAST(file, streams, options, cb);
};

@@ -250,3 +257,4 @@ async.eachOfLimit(files, 30, processFile, (err) => {

}
processFiles(files, streams, callback);
const processOptions = _.take(options, ['minNodes', 'maxNodes']);
processFiles(files, streams, processOptions, callback);
});

@@ -253,0 +261,0 @@ });

{
"name": "bigcode-astgen",
"version": "0.1.0",
"version": "0.1.1",
"repository": "https://github.com/tuvistavie/bigcode-tools.git",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc