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

punch

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

punch - npm Package Compare versions

Comparing version 0.5.11 to 0.5.12

2

example/templates/assets/js/site.js

@@ -1,2 +0,2 @@

$("body").append("Added from site JS");
$("body").append("Added from site JS")

@@ -1,3 +0,2 @@

var jsp = require("uglify-js").parser;
var pro = require("uglify-js").uglify;
var uglifyJS = require("uglify-js");

@@ -14,7 +13,5 @@ module.exports = {

try {
var ast = jsp.parse(input); // parse code and get the initial AST
ast = pro.ast_mangle(ast); // get a new AST with mangled names
ast = pro.ast_squeeze(ast); // get an AST with compression optimizations
output = pro.gen_code(ast); // compressed code here
output = output.replace(/;*$/, ";"); //add a semi-colon to the end
output = uglifyJS.minify(input, {
fromString: true
}).code;
} catch(error) {

@@ -21,0 +18,0 @@ err = error;

@@ -15,3 +15,3 @@ {

],
"version": "0.5.11",
"version": "0.5.12",
"homepage": "https://github.com/laktek/punch",

@@ -41,3 +41,3 @@ "author": "Lakshan Perera <lakshan@web2media.net> (http://laktek.com)",

"mustache": ">0.7.0 || >=0.5.2 <0.7.0",
"uglify-js": ">= 1.3.3",
"uglify-js": ">= 2.2.3",
"underscore": ">= 1.4.2"

@@ -44,0 +44,0 @@ },

@@ -1,3 +0,2 @@

var jsp = require("uglify-js").parser;
var pro = require("uglify-js").uglify;
var uglifyJS = require("uglify-js");
var uglify_minifier = require("../../lib/minifiers/uglify");

@@ -7,19 +6,8 @@

it("calls the callback with the result", function(){
spyOn(jsp, "parse").andCallFake(function(input){
return "initial ast";
});
it("call the callback with the result", function(){
spyOn(pro, "ast_mangle").andCallFake(function(input){
return "initial ast";
spyOn(uglifyJS, "minify").andCallFake(function(input){
return { code: "{ function(){} };", map: null };
});
spyOn(pro, "ast_squeeze").andCallFake(function(input){
return "initial ast";
});
spyOn(pro, "gen_code").andCallFake(function(input){
return "{ function(){} };";
});
var spyCallback = jasmine.createSpy();

@@ -31,4 +19,4 @@ uglify_minifier.minify("test", spyCallback);

it("calls the callback with the error", function(){
spyOn(jsp, "parse").andCallFake(function(input){
it("call the callback with the error", function(){
spyOn(uglifyJS, "minify").andCallFake(function(input){
throw "error";

@@ -35,0 +23,0 @@ });

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