wishthis/node_modules/@octokit/auth-token/dist-src/hook.js
2022-01-21 09:28:41 +01:00

6 lines
300 B
JavaScript

import { withAuthorizationPrefix } from "./with-authorization-prefix";
export async function hook(token, request, route, parameters) {
const endpoint = request.endpoint.merge(route, parameters);
endpoint.headers.authorization = withAuthorizationPrefix(token);
return request(endpoint);
}