Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const handler = async ({
account,
domainFilter: domain,
includeUnverified,
truncate,
raw,
}: BaHandlerOptions): Promise => {
if (!raw) {
spinner.start();
}
try {
const breachData = await breachedAccount(account.trim(), {
domain,
includeUnverified,
truncate,
userAgent,
});
if (breachData && raw) {
logger.log(JSON.stringify(breachData));
} else if (breachData) {
spinner.stop();
logger.log(prettyjson.render(breachData));
} else if (!breachData && !raw) {
spinner.succeed('Good news — no pwnage found!');
}
} catch (err) {
if (!raw) {
spinner.fail(err.message);
export default (account, domain, truncate, raw) => {
if (!raw && process.stdout.isTTY) {
spinner.start();
}
return Promise.resolve(breachedAccount(account, { domain, truncate }))
.then((breachData) => {
if (!raw && process.stdout.isTTY) {
spinner.stop(true);
}
if (breachData && raw) {
logger.log(JSON.stringify(breachData));
} else if (breachData) {
logger.log(prettyjson.render(breachData));
} else if (!breachData && !raw) {
logger.log('Good news — no pwnage found!');
}
})
.catch((err) => {
if (!raw && process.stdout.isTTY) {
spinner.stop(true);
}