Commit Graph

5 Commits

Author SHA1 Message Date
Pablo Rodríguez
74d10a8260 Add 'undefined' to ua-parser-js return values
The type definitions for ua-parser-js are missing undefined on
its return values. UAParser will return undefined if given an
invalid user agent string, and will also return undefined on
values that can't be figured out based on a valid string.

For instance:

const UAParser = require("ua-parser-js")
const ua = new UAParser("Fake ua")

console.log(ua.getBrowser().name) // undefined
2017-08-15 14:12:05 +02:00
Diogo Franco
c22a4bfcf3 ua-parser-js: update tests 2017-07-04 17:53:55 +09:00
Diogo Franco
72db55deb0 ua-parser-js: add missing typeof 2017-07-04 17:43:22 +09:00
Diogo Franco
48268a4480 Correct ua-parser-js's export
ua-parser-js is _not_ an ES module; it is a handwritten AMD module.

It exports itself both by setting the UAParser class as the export and adding a self-reference with the same name, which is why the current definition happens to work with the current commonjs emit.
2017-07-04 17:41:00 +09:00
Andy Hanson
354cec620d Move all packages to a types directory 2017-03-24 14:27:52 -07:00