semantic-branch-version/node_modules/@octokit/auth-token/dist-src/hook.js

7 lines
300 B
JavaScript
Raw Permalink Normal View History

2020-07-04 21:41:06 +08:00
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);
}