MCPcopy
hub / github.com/SeleniumHQ/selenium / requireAtom

Function requireAtom

javascript/selenium-webdriver/lib/http.js:48–66  ·  view source on GitHub ↗

* @param {string} module * @param {string} bazelTarget * @return {!Function}

(module, bazelTarget)

Source from the content-addressed store, hash-verified

46 * @return {!Function}
47 */
48function requireAtom(module, bazelTarget) {
49 try {
50 return require('./atoms/' + module)
51 } catch (ex) {
52 try {
53 const file = bazelTarget.slice(2).replace(':', '/')
54 log_.log(`../../../bazel-bin/${file}`)
55 return require(path.resolve(`../../../bazel-bin/${file}`))
56 } catch (ex2) {
57 log_.severe(ex2)
58 throw new Error(
59 `Failed to import atoms module ${module}. If running in dev mode, you` +
60 ` need to run \`bazel build ${bazelTarget}\` from the project` +
61 `root: ${ex}`,
62 { cause: ex2 },
63 )
64 }
65 }
66}
67
68/**
69 * Converts a headers map to a HTTP header block string.

Callers 1

http.jsFile · 0.85

Calls 2

severeMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected