github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/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  };