hgoebl / mobile-detect.js

Device detection (phone, tablet, desktop, mobile grade, os, versions)
http://hgoebl.github.io/mobile-detect.js/
MIT License
4.12k stars 892 forks source link

What about moving constants to a separate file? #72

Closed teobais closed 6 years ago

teobais commented 6 years ago

Hello,

nice effort.

However, I think it would be much cleaner if we kept constants like phone, tablets, etc. in an isolated file, like the way it's done for math.js or international-anniversary.

How does this sound to you?

Cheers, Thodoris

hgoebl commented 6 years ago

Generally a good idea. But in this case, the js file is generated based on a template without the constants. So from a maintenance point of view, I think it's already ok if you look at the "real" source files. And those guys who want to load the code into the browser are glad to have only a single request.