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

alpaca-sm

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alpaca-sm - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

43

lib/jsParse.js

@@ -40,3 +40,3 @@ var esprima = require('esprima');

function addWrapper(ast, vname) {
var ns = alp.config.get('ns'),

@@ -49,5 +49,5 @@ wrapper = [],

//vname && wrapper.push('var ' + vname + '= '+exports+' = {};' + exports + '=' + vname + 'Extend(' + exports + ',' + vname + ');function ' + vname + 'Extend(target,source){target = target || {};source =source || {};for(var i in source){target[i] = source[i];}return target;}')
vname && wrapper.push(exports+' = '+exports+' || {};');
vname && wrapper.push(exports + ' = ' + exports + ' || {};');
wrapper.push('})(' + ns + ');');

@@ -339,13 +339,13 @@

exports = buildExportsAst(_eId);
exports = buildExportsAst(_eId);
exportStr = ns + '.' + _eId;
exportStr = ns + '.' + _eId;
/*if (pType === Syntax.MemberExpression) {
/*if (pType === Syntax.MemberExpression) {
return buildExportsAst(null,_eId);
return buildExportsAst(null,_eId);
}*/
}*/
return exports;
return exports;

@@ -412,3 +412,3 @@ //}

var content, isMinifile = alp.config.get('optimizer');
var escodegenOptions = {};
if (obj.content) {

@@ -419,3 +419,14 @@ content = obj.content;

//content = escodegen.generate(obj.ast).replace(/;;/gi, "");
content = escodegen.generate(obj.ast);
if (isMinifile) {
escodegenOptions = {
format: {
indent: {
style: '',
base: 0
},
newline: ''
}
}
}
content = escodegen.generate(obj.ast,escodegenOptions);
content = content.replace(/(,\s*(<<<require>>>)\s*(?=;?))|(<<<require>>>\s*,?)/gim, "");

@@ -426,8 +437,10 @@

if (isMinifile) {
if (!_.is(minCb, 'function')) {
/*if (!_.is(minCb, 'function')) {
minCb = minFile;
}
content = content.replace(/(;,)/gi, "");
return minCb(content, !!obj.content);
}*/
content = content.replace(/[;,][\s\n\r]*(?=[;,])/gi,"");
return content;
//return minCb(content, !!obj.content);
} else {

@@ -434,0 +447,0 @@ return content.replace(/([\s\n\r]+);/gi, "");

{
"name": "alpaca-sm",
"version": "1.1.4",
"version": "1.1.5",
"description": "分析Html文件依赖的js文件和css文件",

@@ -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