The waveformMod object is not only about pulse waveforms but also about plenty of others including arbitrary, for which modulating the pulse width would not make sense or would be just technically impossible. Thus, if one would need to modulate the pulse width with this object, one had to do this within a if(waveform == pulse) condition.
Feel free to fork the audio library on GitHub, to add this function and to contribute a pull request.