fix: sending locations (#2339)

* added function to to modify module functions

* fix for locations to be sent

* changes for class Location

- description property was splited into name and address
- added url property
- added ability to pass name, address and url as options while creating an instance

* docs updated

* usage example updated

* added url checking

* fixed url

* updated location property in Message class

* fixed url when http prefix is provided

* injectToFunction updated to be more flexible

* docs clarification

* ESLint fix

* fix: injectToFunction fixed to work properly

* minor fix in injectToFunction

* refactor: added usage of url validator

* small change to improve performance for findImpl fix

* window.compareWwebVersions fixed
This commit is contained in:
alechkos 2023-09-20 23:11:52 +03:00 • committed by GitHub
commit ecf19eb9a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,13 +285,13 @@ class Client extends EventEmitter {
*/
window.compareWwebVersions = (lOperand, operator, rOperand) => {
if (!['>', '>=', '<', '<=', '='].includes(operator)) {
throw class _ extends Error {
throw new class _ extends Error {
constructor(m) { super(m); this.name = 'CompareWwebVersionsError'; }
}('Invalid comparison operator is provided');
}
if (typeof lOperand !== 'string' || typeof rOperand !== 'string') {
throw class _ extends Error {
throw new class _ extends Error {
constructor(m) { super(m); this.name = 'CompareWwebVersionsError'; }
}('A non-string WWeb version type is provided');
}