Merge pull request #606 from rileyjshaw/patch-1

Fix documentation
This commit is contained in:
Faisal Salman 2022-12-06 09:36:29 +07:00 committed by GitHub
commit b814bcd791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ Like so:
```js ```js
let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs
console.log(parser); // {} console.log(parser); // {}
let parserResults = parser.getResults(); let parserResults = parser.getResult();
console.log(parserResults); console.log(parserResults);
/** { /** {
"ua": "", "ua": "",
@ -48,7 +48,7 @@ console.log(parserResults);
} */ } */
``` ```
When you call UAParser without the `new` keyword, it will automatically call `getResults()` function and return the parsed results. When you call UAParser without the `new` keyword, it will automatically call `getResult()` function and return the parsed results.
* `UAParser([uastring][,extensions])` * `UAParser([uastring][,extensions])`
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`