For anyone who imported this as a dependency, why didn't you copy-paste the five lines into your code? I'm genuinely curious.
Similarly, is your company really OK with you just pulling in a dependency and coding onward? Do you review each external dependency's license for compatibility with your company's software? Do you audit each dependency for security issues, backdoors, and other bugs? What dependencies do your dependencies rely on, and have you reviewed them, too? How do you know the dependency works as you think it should work? What is the maintenance plan for this dependency? How often do you plan to update the dependency, and when you do, do you plan to re-audit it?
As someone who has worked on safety-critical marine and aerospace applications, this casual attitude about pulling in dependencies and copy-pasting code is so foreign to me! Is this yolo attitude really how it works in the move-fast-and-break-things universe? No large company I ever worked for would allow any of this without proper vetting and reviewing--even on non-safety-critical programs. Really interesting and scary how best practices are defined in various areas of the software development world!
I totally get your point, though, and completely agree with you on more complex examples. I would not feel comfortable copy-pasting code into my system that I didn't understand or hadn't read through completely. And I avoid dependencies as much as possible.
My best thought is that it saves time to import, it saves visual lines which may make it easier to understand what is code ripe for modification and code that shouldn't be changed.
How it normally goes:
A: why does this exist it's one line?
B: people mess up one-liners all the time.
A: those people are dumb and shouldn't be programmers
How it should go:
A: why does this exist, it's one line?
B: it's not about that, it's used to easily/quickly compose with other similar functions into more complicated things like polyfill, backport, and backcompat bundles for deployment in environments that are quite a bit behind in terms of language support.
A: oh, neat, thanks!
I'd have expected most things that have to support browsers that old would be mature projects that do not get much active development.
NPM bashing is increasingly popular, and for folks that haven't had to utilize these tiny packages they probably do rightly seem superfluous. Are people abusing it? Probably. Is it being used where it doesn't need to be? Probably. Are there long-stable, rarely changed NPM packages created before `Array.isArray` was a thing, which have this as a transitive dependency? Definitely.