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 input(prompter) {
const results = {
type: null,
scope: null,
subject: null,
body: null,
footer: null
};
const {rules} = await load();
await Promise.all(
['type', 'scope', 'subject', 'body', 'footer'].map(
throat(1, async input => {
const inputRules = getRules(input, rules);
const inputSettings = settings[input];
const isHeader = ['type', 'scope', 'subject'].indexOf(input) > -1;
const headerLengthRule = getRules('header', rules).filter(
getHasName('max-length')
)[0];
if (isHeader && headerLengthRule) {
const [, [severity, applicable, length]] = headerLengthRule;
if (severity > 0 && applicable === 'always') {