I think I'd put pad2 as a local variable inside the function that is calling it. Otherwise, if we are promoting it as a general utility function, it deserves a Jasmine test.