diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..76ff691 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +minify: real-minify test-minified + +real-minify: format.js + rm -f format-min.js + closure |format-min.js + +test: + node test_format.js + +test-minified: + node test_format.js format-min.js + +.PHONY: test test-minified diff --git a/format-min.js b/format-min.js new file mode 100644 index 0000000..5db0962 --- /dev/null +++ b/format-min.js @@ -0,0 +1,3 @@ +exports.printf=function(){console.log(exports.format.apply(this,arguments))}; +exports.format=function(d){for(var f=1,i=[].slice.call(arguments),e=0,j=d.length,a="",b,g=!1,h,c=function(){return i[f++]},k=function(){for(var a="";d[e].match(/\d/);)a+=d[e++];return a.length>0?parseInt(a):null};e