UNPKG

wikibase-edit

Version:

Edit Wikibase from NodeJS

17 lines 613 B
import { getFinalTokenFactory } from './get_final_token.js'; import login from './login.js'; export function getTokenFactory(config) { const getFinalToken = getFinalTokenFactory(config); const { credentials } = config; if (('oauth' in credentials && credentials.oauth) || ('browserSession' in credentials && credentials.browserSession)) { // @ts-expect-error return getFinalToken; } else { return async () => { const loginCookies = await login(config); return getFinalToken(loginCookies); }; } } //# sourceMappingURL=get_token.js.map