github.com/nektos/act@v0.2.63/pkg/runner/testdata/actions/node16/node_modules/@octokit/auth-token/dist-src/index.js (about) 1 import { auth } from "./auth"; 2 import { hook } from "./hook"; 3 export const createTokenAuth = function createTokenAuth(token) { 4 if (!token) { 5 throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); 6 } 7 if (typeof token !== "string") { 8 throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); 9 } 10 token = token.replace(/^(token|bearer) +/i, ""); 11 return Object.assign(auth.bind(null, token), { 12 hook: hook.bind(null, token), 13 }); 14 };