You also inherit an entire chain of trust over code you yourself didn't write nor did anyone actually validate. The issue with leftpad.js wasn't that it was stupid, it was that it was dangerous.
The difference is, having an external library allows it to be versioned with breaking changes if necessary, without breaking consumers.