* Extracts the encoded WebElement ID from the object. * * @param {?} obj The object to extract the ID from. * @return {string} the extracted ID. * @throws {TypeError} if the object is not a valid encoded ID.
(obj)
| 44 | * @throws {TypeError} if the object is not a valid encoded ID. |
| 45 | */ |
| 46 | function extractId(obj) { |
| 47 | if (isObject(obj)) { |
| 48 | if (typeof obj[ELEMENT_ID_KEY] === 'string') { |
| 49 | return obj[ELEMENT_ID_KEY] |
| 50 | } else if (typeof obj[LEGACY_ELEMENT_ID_KEY] === 'string') { |
| 51 | return obj[LEGACY_ELEMENT_ID_KEY] |
| 52 | } |
| 53 | } |
| 54 | throw new TypeError('object is not a WebElement ID') |
| 55 | } |
| 56 | |
| 57 | // PUBLIC API |
| 58 |
nothing calls this directly
no test coverage detected