MCPcopy Create free account
hub / github.com/Maccoder3/MAC-MD / API

Function API

lib/helper.js:49–62  ·  view source on GitHub ↗
(name, path = '/', query = {}, apikeyqueryname)

Source from the content-addressed store, hash-verified

47
48/** @type {(name: string, path: string, query: { [Key: string]: any }, apikeyqueryname: string) => string} */
49const API = (name, path = '/', query = {}, apikeyqueryname) =>
50 (name in global.APIs ? global.APIs[name] : name) +
51 path +
52 (query || apikeyqueryname
53 ? '?' +
54 new URLSearchParams(
55 Object.entries({
56 ...query,
57 ...(apikeyqueryname
58 ? { [apikeyqueryname]: global.APIKeys[name in global.APIs ? global.APIs[name] : name] }
59 : {}),
60 })
61 )
62 : '')
63/** @type {ReturnType<yargs.Argv['parse']>} */
64const opts = new Object(yargs(process.argv.slice(2)).exitProcess(false).parse())
65const prefix = new RegExp(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected