Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

insert-module-globals

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

insert-module-globals - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

31

index.js

@@ -57,9 +57,8 @@ var parseScope = require('lexical-scope');

);
var varNames = Object.keys(vars)
var quick = varNames.map(function (name) {
return new RegExp('\\b'+name+'\\b', 'g')
})
var varNames = Object.keys(vars);
var quick = RegExp(varNames.map(function (name) {
return '\\b' + name + '\\b';
}).join('|'));
var resolved = {};

@@ -70,10 +69,11 @@

function write (row) {
var tr = this;
//remove hashbang if present
row.source = String(row.source).replace(/^#![^\n]*\n/, '\n');
if (!opts.always
&& quick.every(function (rx) { return !rx.test(row.source) })
) return this.queue(row);
if (opts.always !== true && !quick.test(row.source)) {
return tr.queue(row);
}
var scope = opts.always

@@ -83,7 +83,6 @@ ? { globals: { implicit: varNames } }

;
var globals = {};
var tr = this;
Object.keys(vars).forEach(function (name) {
varNames.forEach(function (name) {
if (scope.globals.implicit.indexOf(name) >= 0) {

@@ -90,0 +89,0 @@ var value = vars[name].call(tr, row, basedir);

{
"name": "insert-module-globals",
"version": "1.1.1",
"version": "1.1.2",
"description": "insert implicit module globals into a module-deps stream",

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

Sorry, the diff of this file is too big to display

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