Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function downloadFromEndpointUrl(argv: Arguments) {
const endpointHeaders = {}
if (argv.header) {
const headers = Array.isArray(argv.header) ? argv.header : [argv.header]
Object.assign(
endpointHeaders,
...headers.map(h => ({ [h.split('=')[0]]: h.split('=')[1] })),
)
}
const endpoint = new GraphQLEndpoint({
url: argv.endpoint,
headers: endpointHeaders,
})
await updateSingleProjectEndpoint(undefined, endpoint, 'unnamed', argv)
}