MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / isPromise

Function isPromise

javascript/selenium-webdriver/lib/util.js:36–45  ·  view source on GitHub ↗

* Determines whether a value should be treated as a promise. * Any object whose "then" property is a function will be considered a promise. * * @param {?} value The value to test. * @return {boolean} Whether the value is a promise.

(value)

Source from the content-addressed store, hash-verified

34 * @return {boolean} Whether the value is a promise.
35 */
36function isPromise(value) {
37 try {
38 // Use array notation so the Closure compiler does not obfuscate away our
39 // contract.
40 return (typeof value === 'object' || typeof value === 'function') && typeof value['then'] === 'function'
41 /*eslint no-unused-vars: "off"*/
42 } catch (ex) {
43 return false
44 }
45}
46
47module.exports = {
48 isObject,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected