From 6d53f79fdc9f2436658240efbc9d3198d2aa10f3 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 5 Apr 2013 23:59:37 -0700 Subject: [PATCH] feat(vsprintf): Support variable-length arg list --- Readme.md | 3 +++ format-min.js | 5 +++-- format.js | 5 ++++- test_format.js | 11 +++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index a263889..762b165 100644 --- a/Readme.md +++ b/Readme.md @@ -31,6 +31,9 @@ Usage vsprintf('%d is the answer to %s', [42, what]) // => '42 is the answer to life, the universe, and everything' + vsprintf('%d is the answer to %s', 42, what) + // => '42 is the answer to life, the universe, and everything' + Supported format specifiers: b, c, d, f, o, s, x, and X. See `man 3 printf` or `man 1 printf` for details. diff --git a/format-min.js b/format-min.js index 9e0f386..1cfc547 100644 --- a/format-min.js +++ b/format-min.js @@ -1,2 +1,3 @@ -(function(){function f(){console.log(e.apply(null,arguments))}function e(h){for(var e=1,d=[].slice.call(arguments),g=0,f=h.length,a="",b,i=!1,j,c=function(){return d[e++]},k=function(){for(var a="";h[g].match(/\d/);)a+=h[g++];return a.length>0?parseInt(a):null};g