wizer 10.0.0

The WebAssembly Pre-Initializer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { auth } from "./auth";
import { hook } from "./hook";
export const createTokenAuth = function createTokenAuth(token) {
    if (!token) {
        throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
    }
    if (typeof token !== "string") {
        throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
    }
    token = token.replace(/^(token|bearer) +/i, "");
    return Object.assign(auth.bind(null, token), {
        hook: hook.bind(null, token),
    });
};