code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function toCommandProperties(annotationProperties) {
if (!Object.keys(annotationProperties).length) {
return {};
}
return {
title: annotationProperties.title,
file: annotationProperties.file,
line: annotationProperties.startLine,
endLine: annotationProperties.endLine,... | @param annotationProperties
@returns The command properties to send with the actual annotation command
See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 | toCommandProperties | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function exec(commandLine, args, options) {
return __awaiter(this, void 0, void 0, function* () {
const commandArgs = tr.argStringToArray(commandLine);
if (commandArgs.length === 0) {
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
}
// Path to tool t... | Exec a command.
Output will be streamed to the live console.
Returns promise with return code
@param commandLine command to execute (can include additional args). Must be correctly escaped.
@param args optional arguments for tool. Escaping is handled by the lib.
@param options ... | exec | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getExecOutput(commandLine, args, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
let stdout = '';
let stderr = '';
//Using string decoder covers the case where a mult-byte character is split
const stdoutDecoder = new string_decoder_1.StringDe... | Exec a command and get the output.
Output will be streamed to the live console.
Returns promise with the exit code and collected stdout and stderr
@param commandLine command to execute (can include additional args). Must be correctly escaped.
@param args optional arguments for tool. ... | getExecOutput | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
stdErrListener = (data) => {
stderr += stderrDecoder.write(data);
if (originalStdErrListener) {
originalStdErrListener(data);
}
} | Exec a command and get the output.
Output will be streamed to the live console.
Returns promise with the exit code and collected stdout and stderr
@param commandLine command to execute (can include additional args). Must be correctly escaped.
@param args optional arguments for tool. ... | stdErrListener | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
stdErrListener = (data) => {
stderr += stderrDecoder.write(data);
if (originalStdErrListener) {
originalStdErrListener(data);
}
} | Exec a command and get the output.
Output will be streamed to the live console.
Returns promise with the exit code and collected stdout and stderr
@param commandLine command to execute (can include additional args). Must be correctly escaped.
@param args optional arguments for tool. ... | stdErrListener | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
stdOutListener = (data) => {
stdout += stdoutDecoder.write(data);
if (originalStdoutListener) {
originalStdoutListener(data);
}
} | Exec a command and get the output.
Output will be streamed to the live console.
Returns promise with the exit code and collected stdout and stderr
@param commandLine command to execute (can include additional args). Must be correctly escaped.
@param args optional arguments for tool. ... | stdOutListener | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
stdOutListener = (data) => {
stdout += stdoutDecoder.write(data);
if (originalStdoutListener) {
originalStdoutListener(data);
}
} | Exec a command and get the output.
Output will be streamed to the live console.
Returns promise with the exit code and collected stdout and stderr
@param commandLine command to execute (can include additional args). Must be correctly escaped.
@param args optional arguments for tool. ... | stdOutListener | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
exec() {
return __awaiter(this, void 0, void 0, function* () {
// root the tool path if it is unrooted and contains relative pathing
if (!ioUtil.isRooted(this.toolPath) &&
(this.toolPath.includes('/') ||
(IS_WINDOWS && this.toolPath.includes('\\')))) {... | Exec a tool.
Output will be streamed to the live console.
Returns promise with return code
@param tool path to tool to exec
@param options optional exec options. See ExecOptions
@returns number | exec | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function argStringToArray(argString) {
const args = [];
let inQuotes = false;
let escaped = false;
let arg = '';
function append(c) {
// we only escape double quotes.
if (escaped && c !== '"') {
arg += '\\';
}
arg += c;
escaped = false;
}
f... | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | argStringToArray | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function append(c) {
// we only escape double quotes.
if (escaped && c !== '"') {
arg += '\\';
}
arg += c;
escaped = false;
} | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | append | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(options, toolPath) {
super();
this.processClosed = false; // tracks whether the process has exited and stdio is closed
this.processError = '';
this.processExitCode = 0;
this.processExited = false; // tracks whether the process has exited
this.processStderr = f... | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
CheckComplete() {
if (this.done) {
return;
}
if (this.processClosed) {
this._setResult();
}
else if (this.processExited) {
this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
}
} | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | CheckComplete | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_debug(message) {
this.emit('debug', message);
} | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | _debug | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_setResult() {
// determine whether there is an error
let error;
if (this.processExited) {
if (this.processError) {
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: $... | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | _setResult | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
static HandleTimeout(state) {
if (state.done) {
return;
}
if (!state.processClosed && state.processExited) {
const message = `The STDIO streams did not close within ${state.delay /
1000} seconds of the exit event from process '${state.toolPath}'. This may ... | Convert an arg string to an array of args. Handles escaping
@param argString string of arguments
@returns string[] array of arguments | HandleTimeout | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor() {
var _a, _b, _c;
this.payload = {};
if (process.env.GITHUB_EVENT_PATH) {
if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
}
... | Hydrate the context from the environment | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get issue() {
const payload = this.payload;
return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
} | Hydrate the context from the environment | issue | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get repo() {
if (process.env.GITHUB_REPOSITORY) {
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
return { owner, repo };
}
if (this.payload.repository) {
return {
owner: this.payload.repository.owner.login,
repo... | Hydrate the context from the environment | repo | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getOctokit(token, options, ...additionalPlugins) {
const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
} | Returns a hydrated octokit ready to use for GitHub Actions
@param token the repo PAT or GITHUB_TOKEN
@param options other options to set | getOctokit | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getOctokitOptions(token, options) {
const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
// Auth
const auth = Utils.getAuthString(token, opts);
if (auth) {
opts.auth = auth;
}
return opts;
} | Convience function to correctly format Octokit Options to pass into the constructor.
@param token the repo PAT or GITHUB_TOKEN
@param options other options to set | getOctokitOptions | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getProxyUrl(serverUrl) {
const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : '';
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | getProxyUrl | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(message, statusCode) {
super(message);
this.name = 'HttpClientError';
this.statusCode = statusCode;
Object.setPrototypeOf(this, HttpClientError.prototype);
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(message) {
this.message = message;
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readBody() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
let output = Buffer.alloc(0);
this.message.on('data', (chunk) => {
output = Buffer.concat([output, chu... | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | readBody | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readBodyBuffer() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
const chunks = [];
this.message.on('data', (chunk) => {
chunks.push(chunk);
});
... | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | readBodyBuffer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isHttps(requestUrl) {
const parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:';
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | isHttps | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(userAgent, handlers, requestOptions) {
this._ignoreSslError = false;
this._allowRedirects = true;
this._allowRedirectDowngrade = false;
this._maxRedirects = 50;
this._allowRetries = false;
this._maxRetries = 1;
this._keepAlive = false;
this._di... | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
options(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | options | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('GET', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | get | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
del(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | del | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
post(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('POST', requestUrl, data, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | post | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
patch(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | patch | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
put(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('PUT', requestUrl, data, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | put | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
head(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | head | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
sendStream(verb, requestUrl, stream, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request(verb, requestUrl, stream, additionalHeaders);
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | sendStream | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
getJson(requestUrl, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
const res = yield this.get(requestUrl, additionalHeader... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | getJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
postJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | postJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
putJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | putJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
patchJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | patchJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
request(verb, requestUrl, data, headers) {
return __awaiter(this, void 0, void 0, function* () {
if (this._disposed) {
throw new Error('Client has already been disposed.');
}
const parsedUrl = new URL(requestUrl);
let info = this._prepareRequest(ve... | Makes a raw http request.
All other methods such as get, post, patch, and request ultimately call this.
Prefer get, del, post and patch | request | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
dispose() {
if (this._agent) {
this._agent.destroy();
}
this._disposed = true;
} | Needs to be called if keepAlive is set to true in request options. | dispose | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
requestRaw(info, data) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
function callbackForResult(err, res) {
if (err) {
reject(err);
}
else if (!res)... | Raw request.
@param info
@param data | requestRaw | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function callbackForResult(err, res) {
if (err) {
reject(err);
}
else if (!res) {
// If `err` is not passed, then `res` must be passed.
reject(new Error('Unknown error'));
... | Raw request.
@param info
@param data | callbackForResult | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
requestRawWithCallback(info, data, onResult) {
if (typeof data === 'string') {
if (!info.options.headers) {
info.options.headers = {};
}
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
}
let callbackCalled = false;
... | Raw request with callback.
@param info
@param data
@param onResult | requestRawWithCallback | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function handleResult(err, res) {
if (!callbackCalled) {
callbackCalled = true;
onResult(err, res);
}
} | Raw request with callback.
@param info
@param data
@param onResult | handleResult | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
getAgent(serverUrl) {
const parsedUrl = new URL(serverUrl);
return this._getAgent(parsedUrl);
} | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | getAgent | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
getAgentDispatcher(serverUrl) {
const parsedUrl = new URL(serverUrl);
const proxyUrl = pm.getProxyUrl(parsedUrl);
const useProxy = proxyUrl && proxyUrl.hostname;
if (!useProxy) {
return;
}
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
} | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | getAgentDispatcher | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_prepareRequest(method, requestUrl, headers) {
const info = {};
info.parsedUrl = requestUrl;
const usingSsl = info.parsedUrl.protocol === 'https:';
info.httpModule = usingSsl ? https : http;
const defaultPort = usingSsl ? 443 : 80;
info.options = {};
info.options.... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _prepareRequest | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
}
return lowercaseKeys(headers || {});
} | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _mergeHeaders | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
let clientHeader;
if (this.requestOptions && this.requestOptions.headers) {
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
}
return additionalHeaders[header] || clientHeader || _default;
... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _getExistingOrDefaultHeader | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_getAgent(parsedUrl) {
let agent;
const proxyUrl = pm.getProxyUrl(parsedUrl);
const useProxy = proxyUrl && proxyUrl.hostname;
if (this._keepAlive && useProxy) {
agent = this._proxyAgent;
}
if (this._keepAlive && !useProxy) {
agent = this._agent;
... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _getAgent | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_getProxyAgentDispatcher(parsedUrl, proxyUrl) {
let proxyAgent;
if (this._keepAlive) {
proxyAgent = this._proxyAgentDispatcher;
}
// if agent is already assigned use that agent.
if (proxyAgent) {
return proxyAgent;
}
const usingSsl = parsed... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _getProxyAgentDispatcher | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_performExponentialBackoff(retryNumber) {
return __awaiter(this, void 0, void 0, function* () {
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
return new Promise(resolve => setTimeout(() => re... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _performExponentialBackoff | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_processResponse(res, options) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
const statusCode = res.message.statusCode || 0;
const response = {
statusC... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _processResponse | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function dateTimeDeserializer(key, value) {
if (typeof value === 'string') {
const a = new Date(value);
if (!isNaN(a.valueOf())) {
return a;
}
}
return value;
... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | dateTimeDeserializer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getProxyUrl(serverUrl) {
const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : '';
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | getProxyUrl | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(message, statusCode) {
super(message);
this.name = 'HttpClientError';
this.statusCode = statusCode;
Object.setPrototypeOf(this, HttpClientError.prototype);
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(message) {
this.message = message;
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readBody() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
let output = Buffer.alloc(0);
this.message.on('data', (chunk) => {
output = Buffer.concat([output, chu... | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | readBody | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readBodyBuffer() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
const chunks = [];
this.message.on('data', (chunk) => {
chunks.push(chunk);
});
... | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | readBodyBuffer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isHttps(requestUrl) {
const parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:';
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | isHttps | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor(userAgent, handlers, requestOptions) {
this._ignoreSslError = false;
this._allowRedirects = true;
this._allowRedirectDowngrade = false;
this._maxRedirects = 50;
this._allowRetries = false;
this._maxRetries = 1;
this._keepAlive = false;
this._di... | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
options(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | options | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('GET', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | get | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
del(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | del | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
post(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('POST', requestUrl, data, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | post | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
patch(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | patch | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
put(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('PUT', requestUrl, data, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | put | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
head(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | head | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
sendStream(verb, requestUrl, stream, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request(verb, requestUrl, stream, additionalHeaders);
});
} | Returns the proxy URL, depending upon the supplied url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | sendStream | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
getJson(requestUrl, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
const res = yield this.get(requestUrl, additionalHeader... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | getJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
postJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | postJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
putJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | putJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
patchJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
... | Gets a typed object from an endpoint
Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise | patchJson | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
request(verb, requestUrl, data, headers) {
return __awaiter(this, void 0, void 0, function* () {
if (this._disposed) {
throw new Error('Client has already been disposed.');
}
const parsedUrl = new URL(requestUrl);
let info = this._prepareRequest(ve... | Makes a raw http request.
All other methods such as get, post, patch, and request ultimately call this.
Prefer get, del, post and patch | request | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
dispose() {
if (this._agent) {
this._agent.destroy();
}
this._disposed = true;
} | Needs to be called if keepAlive is set to true in request options. | dispose | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
requestRaw(info, data) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
function callbackForResult(err, res) {
if (err) {
reject(err);
}
else if (!res)... | Raw request.
@param info
@param data | requestRaw | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function callbackForResult(err, res) {
if (err) {
reject(err);
}
else if (!res) {
// If `err` is not passed, then `res` must be passed.
reject(new Error('Unknown error'));
... | Raw request.
@param info
@param data | callbackForResult | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
requestRawWithCallback(info, data, onResult) {
if (typeof data === 'string') {
if (!info.options.headers) {
info.options.headers = {};
}
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
}
let callbackCalled = false;
... | Raw request with callback.
@param info
@param data
@param onResult | requestRawWithCallback | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function handleResult(err, res) {
if (!callbackCalled) {
callbackCalled = true;
onResult(err, res);
}
} | Raw request with callback.
@param info
@param data
@param onResult | handleResult | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
getAgent(serverUrl) {
const parsedUrl = new URL(serverUrl);
return this._getAgent(parsedUrl);
} | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | getAgent | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
getAgentDispatcher(serverUrl) {
const parsedUrl = new URL(serverUrl);
const proxyUrl = pm.getProxyUrl(parsedUrl);
const useProxy = proxyUrl && proxyUrl.hostname;
if (!useProxy) {
return;
}
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
} | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | getAgentDispatcher | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_prepareRequest(method, requestUrl, headers) {
const info = {};
info.parsedUrl = requestUrl;
const usingSsl = info.parsedUrl.protocol === 'https:';
info.httpModule = usingSsl ? https : http;
const defaultPort = usingSsl ? 443 : 80;
info.options = {};
info.options.... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _prepareRequest | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
}
return lowercaseKeys(headers || {});
} | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _mergeHeaders | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
let clientHeader;
if (this.requestOptions && this.requestOptions.headers) {
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
}
return additionalHeaders[header] || clientHeader || _default;
... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _getExistingOrDefaultHeader | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_getAgent(parsedUrl) {
let agent;
const proxyUrl = pm.getProxyUrl(parsedUrl);
const useProxy = proxyUrl && proxyUrl.hostname;
if (this._keepAlive && useProxy) {
agent = this._proxyAgent;
}
if (!useProxy) {
agent = this._agent;
}
// ... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _getAgent | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_getProxyAgentDispatcher(parsedUrl, proxyUrl) {
let proxyAgent;
if (this._keepAlive) {
proxyAgent = this._proxyAgentDispatcher;
}
// if agent is already assigned use that agent.
if (proxyAgent) {
return proxyAgent;
}
const usingSsl = parsed... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _getProxyAgentDispatcher | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_performExponentialBackoff(retryNumber) {
return __awaiter(this, void 0, void 0, function* () {
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
return new Promise(resolve => setTimeout(() => re... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _performExponentialBackoff | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_processResponse(res, options) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
const statusCode = res.message.statusCode || 0;
const response = {
statusC... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | _processResponse | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function dateTimeDeserializer(key, value) {
if (typeof value === 'string') {
const a = new Date(value);
if (!isNaN(a.valueOf())) {
return a;
}
}
return value;
... | Gets an http agent. This function is useful when you need an http agent that handles
routing through a proxy server - depending upon the url and proxy environment variables.
@param serverUrl The server URL where the request will be sent. For example, https://api.github.com | dateTimeDeserializer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isRooted(p) {
p = normalizeSeparators(p);
if (!p) {
throw new Error('isRooted() parameter "p" cannot be empty');
}
if (exports.IS_WINDOWS) {
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
); // e.g. C: or C:\hello
}
return p.start... | On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
\, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). | isRooted | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function tryGetExecutablePath(filePath, extensions) {
return __awaiter(this, void 0, void 0, function* () {
let stats = undefined;
try {
// test file exists
stats = yield exports.stat(filePath);
}
catch (err) {
if (err.code !== 'ENOENT') {
... | Best effort attempt to determine whether a file exists and is executable.
@param filePath file path to check
@param extensions additional file extensions to try
@return if file exists and is executable, returns the file path. otherwise empty string. | tryGetExecutablePath | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function normalizeSeparators(p) {
p = p || '';
if (exports.IS_WINDOWS) {
// convert slashes on Windows
p = p.replace(/\//g, '\\');
// remove redundant slashes
return p.replace(/\\\\+/g, '\\');
}
// remove redundant slashes
return p.replace(/\/\/+/g, '/');
} | Best effort attempt to determine whether a file exists and is executable.
@param filePath file path to check
@param extensions additional file extensions to try
@return if file exists and is executable, returns the file path. otherwise empty string. | normalizeSeparators | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isUnixExecutable(stats) {
return ((stats.mode & 1) > 0 ||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
} | Best effort attempt to determine whether a file exists and is executable.
@param filePath file path to check
@param extensions additional file extensions to try
@return if file exists and is executable, returns the file path. otherwise empty string. | isUnixExecutable | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getCmdPath() {
var _a;
return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
} | Best effort attempt to determine whether a file exists and is executable.
@param filePath file path to check
@param extensions additional file extensions to try
@return if file exists and is executable, returns the file path. otherwise empty string. | getCmdPath | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function cp(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const { force, recursive, copySourceDirectory } = readCopyOptions(options);
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
// Dest is an existing file, but not forc... | Copies a file or folder.
Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@param source source path
@param dest destination path
@param options optional. See CopyOptions. | cp | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function mv(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
if (yield ioUtil.exists(dest)) {
let destExists = true;
if (yield ioUtil.isDirectory(dest)) {
// If dest is directory copy src into dest
dest = path.join(de... | Moves a path.
@param source source path
@param dest destination path
@param options optional. See MoveOptions. | mv | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function rmRF(inputPath) {
return __awaiter(this, void 0, void 0, function* () {
if (ioUtil.IS_WINDOWS) {
// Check for invalid characters
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
if (/[*"<>|]/.test(inputPath)) {
throw new Erro... | Remove a path recursively with force
@param inputPath path to remove | rmRF | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(fsPath, 'a path argument must be provided');
yield ioUtil.mkdir(fsPath, { recursive: true });
});
} | Make a directory. Creates the full path with folders in between
Will throw if it fails
@param fsPath path to create
@returns Promise<void> | mkdirP | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function which(tool, check) {
return __awaiter(this, void 0, void 0, function* () {
if (!tool) {
throw new Error("parameter 'tool' is required");
}
// recursive when check=true
if (check) {
const result = yield which(tool, false);
if (!result) {
... | Returns path of a tool had the tool actually been invoked. Resolves via paths.
If you check and the tool does not exist, it will throw.
@param tool name of the tool
@param check whether to check if tool exists
@returns Promise<string> path to tool | which | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.