* Helper function to create a url with the proper path for an api request. * @param {String} [options.email] - The user id's email address * @param {String} [options.keyId] - The long 16 char key id * @param {String} [options.fingerprint] - The 40 char v4 fingerprint * @return {String} The co
({email, keyId, fingerprint} = {})
| 69 | * @return {String} The complete request url |
| 70 | */ |
| 71 | function url({email, keyId, fingerprint} = {}) { |
| 72 | const url = `${DEFAULT_URL}/vks/v1/`; |
| 73 | if (email) { |
| 74 | return `${url}by-email/${encodeURIComponent(email)}`; |
| 75 | } else if (fingerprint) { |
| 76 | return `${url}by-fingerprint/${encodeURIComponent(removeHexPrefix(fingerprint).toUpperCase())}`; |
| 77 | } else if (keyId) { |
| 78 | return `${url}by-keyid/${encodeURIComponent(removeHexPrefix(keyId).toUpperCase())}`; |
| 79 | } |
| 80 | return url; |
| 81 | } |
no test coverage detected