Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
> = options => {
const appId = options.appId;
const transporter = createTransporter(options);
transporter.setHosts(
[
{ url: `${appId}-dsn.algolia.net`, accept: CallEnum.Read },
{ url: `${appId}.algolia.net`, accept: CallEnum.Write },
].concat(
shuffle([
{ url: `${appId}-1.algolianet.com`, accept: CallEnum.Any },
{ url: `${appId}-2.algolianet.com`, accept: CallEnum.Any },
{ url: `${appId}-3.algolianet.com`, accept: CallEnum.Any },
])
)
);
const auth = createAuth(
options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders,
appId,
options.apiKey
);
transporter.addHeaders({
...auth.headers(),
...{ 'content-type': 'application/x-www-form-urlencoded' },