Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
segment => delimiters.test(segment) || ensure.case(segment, check.case)
);
const result = checks.some(check => {
const r = ensure.case(header, check.case);
return negated(check.when) ? !r : r;
});
const result = checks.some(check => {
const r = ensure.case(subject, check.case);
return negated(check.when) ? !r : r;
});
const result = checks.some(check => {
const r = ensure.case(type, check.case);
return negated(check.when) ? !r : r;
});
export default (parsed, when, value) => {
const {body} = parsed;
if (!body) {
return [true];
}
const negated = when === 'never';
const result = ensure.case(body, value);
return [
negated ? !result : result,
message([`body must`, negated ? `not` : null, `be ${value}`])
];
};