Yeah, and I get your point too. Eight lines of code? Yeah, you don't need a library. But usually when someone says "15 minutes" they mean 1 - 2 days. So things of that complexity is when it's obviously you should choose a good OSS lib.
It depends on many factors:
- what is the problem? (some problems are really hard, some problems are trivial and just seem hard)
- is developer experienced enough to build own solution?
- are existing solutions good or badly written?(I often refrained from using existing solution when I looked on bloated code in it).
- is solution suitable to project? ("too much bundle size", "doesn't support X", "not too configurable", "too slow", "too hard to use").
etc.