@octokit/types#RequestOptions TypeScript Examples

The following examples show how to use @octokit/types#RequestOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: merge.ts    From file-changes-action with MIT License 6 votes vote down vote up
fn = jest.fn((data: EndpointOptions, response?: number) => {
  if (data.base === 'error' || data.pull_number === 'error') {
    throw new Error(JSON.stringify({name: 'HttpError', status: '500'}))
  }
  if (data.base === 'unknown' || data.pull_number === 'unknown') {
    throw JSON.stringify({idk: 'error', message: 'test'})
  }
  if (
    (!data.base && !data.head && Number.isNaN(data.pull_number)) ||
    (!data.base && data.head) ||
    (data.base && !data.head)
  )
    return {
      ...OctokitPullsListFilesEndpointMergeResponse,
      ...{pull_number: NaN, base: '', head: ''}
    } as RequestOptions
  if (data.pull_number) {
    return {
      ...OctokitPullsListFilesEndpointMergeResponse,
      ...data
    } as RequestOptions
  }
  return {
    ...OctokitReposCompareCommitsEndpointMergeResponse,
    ...data
  } as RequestOptions
})
Example #2
Source File: parse.d.ts    From aws-ssm-send-command with MIT License 5 votes vote down vote up
export declare function parse(options: EndpointDefaults): RequestOptions;
Example #3
Source File: index.d.ts    From aws-ssm-send-command with MIT License 5 votes vote down vote up
/**
     * Request options that lead to the error.
     */
    request: RequestOptions;