Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (parsed, when) => {
const negated = when === 'never';
const notEmpty = ensure.notEmpty(parsed.footer);
return [
negated ? notEmpty : !notEmpty,
message(['footer', negated ? 'may not' : 'must', 'be empty'])
];
};
export default (parsed, when) => {
const negated = when === 'never';
const notEmpty = ensure.notEmpty(parsed.body);
return [
negated ? notEmpty : !notEmpty,
message(['body', negated ? 'may not' : 'must', 'be empty'])
];
};
export default (parsed, when) => {
const negated = when === 'never';
const notEmpty = ensure.notEmpty(parsed.type);
return [
negated ? notEmpty : !notEmpty,
message(['type', negated ? 'may not' : 'must', 'be empty'])
];
};
export default (parsed, when = 'never') => {
const negated = when === 'always';
const notEmpty = ensure.notEmpty(parsed.scope);
return [
negated ? !notEmpty : notEmpty,
message(['scope', negated ? 'must' : 'may not', 'be empty'])
];
};
export default (parsed, when) => {
const negated = when === 'never';
const notEmpty = ensure.notEmpty(parsed.subject);
return [
negated ? notEmpty : !notEmpty,
message(['subject', negated ? 'may not' : 'must', 'be empty'])
];
};