It's to be expected with live includes that something like this would happen -- doing such a thing is a roll of the dice and anyone foolish enough to do so got what was coming to them.
JavaScript is one of the places where you see endless idiotic "frameworks" being used for this type of tripe; and the code snippet provided in that article clearly shows why you'd have to be a dumbass to blindly include something so simple to write, that's SO poorly written!
It's like what I say about jQuery -- for people who know nothing about JavaScript, BY people who know nothing about JavaScript.
I mean that's some real herpaderp for what could simply be: function leftpad(str, len, ch) { str = String(str); return String(!ch && ch !== 0 ? ' ' : ch).repeat(Math.max(len - str.length, 0)) + str; }
In fact it reeks of someone blindly copying a C example to JavaScript without having bothered learning to use JS properly first.
Of course you get into scripttard projects that rely on things like NPM, and the entire blasted thing is typically just blind copypasta of other people's work by those who don't know enough JavaScript to do a blasted thing on their own. It's led to endless JS based projects and codebases that are bloated, insecure, slow train wrecks that just BEG to fall apart the moment something like this happens.
... and then the mouth-breathers who try to support this development technique call writing more code that relies on more code written by others that they don't even understand "easier" -- when really what they are saying is "wah, wah, I don't wanna learn!" like some petulant first grader.