setup-dotnet/node_modules/@octokit/request/dist-node/index.js.map
2019-10-03 16:35:25 -07:00

1 line
8.0 KiB
Plaintext

{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-buffer-response.js","../dist-src/fetch-wrapper.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"0.0.0-development\";\n","export default function getBufferResponse(response) {\n return response.arrayBuffer();\n}\n","import isPlainObject from \"is-plain-object\";\nimport nodeFetch from \"node-fetch\";\nimport { RequestError } from \"@octokit/request-error\";\nimport getBuffer from \"./get-buffer-response\";\nexport default function fetchWrapper(requestOptions) {\n if (isPlainObject(requestOptions.body) ||\n Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n let headers = {};\n let status;\n let url;\n const fetch = (requestOptions.request && requestOptions.request.fetch) || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, requestOptions.request))\n .then(response => {\n url = response.url;\n status = response.status;\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n if (status === 204 || status === 205) {\n return;\n }\n // GitHub API returns 200 for HEAD requsets\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n throw new RequestError(response.statusText, status, {\n headers,\n request: requestOptions\n });\n }\n if (status === 304) {\n throw new RequestError(\"Not modified\", status, {\n headers,\n request: requestOptions\n });\n }\n if (status >= 400) {\n return response\n .text()\n .then(message => {\n const error = new RequestError(message, status, {\n headers,\n request: requestOptions\n });\n try {\n Object.assign(error, JSON.parse(error.message));\n }\n catch (e) {\n // ignore, see octokit/rest.js#684\n }\n throw error;\n });\n }\n const contentType = response.headers.get(\"content-type\");\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n return getBuffer(response);\n })\n .then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n })\n .catch(error => {\n if (error instanceof RequestError) {\n throw error;\n }\n throw new RequestError(error.message, 500, {\n headers,\n request: requestOptions\n });\n });\n}\n","import fetchWrapper from \"./fetch-wrapper\";\nexport default function withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n","import { endpoint } from \"@octokit/endpoint\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport withDefaults from \"./with-defaults\";\nexport const request = withDefaults(endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${getUserAgent()}`\n }\n});\n"],"names":["VERSION","getBufferResponse","response","arrayBuffer","fetchWrapper","requestOptions","isPlainObject","body","Array","isArray","JSON","stringify","headers","status","url","fetch","request","nodeFetch","Object","assign","method","redirect","then","keyAndValue","RequestError","statusText","text","message","error","parse","e","contentType","get","test","json","getBuffer","data","catch","withDefaults","oldEndpoint","newDefaults","endpoint","defaults","newApi","route","parameters","endpointOptions","merge","hook","bind","getUserAgent"],"mappings":";;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAQ,SAASC,iBAAT,CAA2BC,QAA3B,EAAqC;SACzCA,QAAQ,CAACC,WAAT,EAAP;;;ACGW,SAASC,YAAT,CAAsBC,cAAtB,EAAsC;MAC7CC,aAAa,CAACD,cAAc,CAACE,IAAhB,CAAb,IACAC,KAAK,CAACC,OAAN,CAAcJ,cAAc,CAACE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