MCPcopy Index your code
hub / github.com/chavyleung/scripts / initGotEnv

Method initGotEnv

Env.js:334–351  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

332 }
333
334 initGotEnv(opts) {
335 this.got = this.got ? this.got : require('got')
336 this.cktough = this.cktough ? this.cktough : require('tough-cookie')
337 this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar()
338 if (opts) {
339 opts.headers = opts.headers ? opts.headers : {}
340 if (opts) {
341 opts.headers = opts.headers ? opts.headers : {}
342 if (
343 undefined === opts.headers.cookie &&
344 undefined === opts.headers.Cookie &&
345 undefined === opts.cookieJar
346 ) {
347 opts.cookieJar = this.ckjar
348 }
349 }
350 }
351 }
352
353 get(request, callback = () => {}) {
354 if (request.headers) {

Callers 2

getMethod · 0.45
postMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected